feat: 自动导入解析器

This commit is contained in:
2023-07-13 11:00:04 +08:00
parent 58e14e57dd
commit fd8981db73
3 changed files with 71 additions and 11 deletions

29
utils/resolver.d.ts vendored
View File

@ -1,14 +1,31 @@
/*
* @Author: peerless_hero peerless_hero@outlook.com
* @Date: 2023-07-13 04:11:13
* @LastEditors: peerless_hero peerless_hero@outlook.com
* @LastEditTime: 2023-07-13 04:15:06
* @LastEditors: zhaojinfeng 121016171@qq.com
* @LastEditTime: 2023-07-13 10:58:35
* @FilePath: \uni\utils\resolver.d.ts
* @Description:
*
*/
export const resolverThzxcx: (name: string) =>({
name: string;
as: string;
type ComponentResolveResult = {
}
interface ImportInfo {
as?: string;
name?: string;
from: string;
})
}
type SideEffectsInfo = (ImportInfo | string)[] | ImportInfo | string | undefined;
interface ComponentInfo extends ImportInfo {
sideEffects?: SideEffectsInfo;
}
type ComponentResolverFunction = (name: string) => ComponentResolveResult;
/** ThUi 自动导入解析器 */
export const resolverThzxcx: ComponentResolverFunction
/** thorui-uni 自动导入解析器 */
export const resolverTui: ComponentResolverFunction
/** uni-ui 自动导入解析器 */
export const resolveruUniUi: ComponentResolverFunction