import _glob from 'glob'; import program from 'commander'; import { Weshop, Wechat } from '../../typings/index'; export declare function initCache(configPath?: string, env?: Weshop.Env): void; export declare function getWeshopConfig(configPath?: string): Weshop.Config; export declare function getWeshopDirs(env?: Weshop.Env): Weshop.Dirs; /** * 新的 weshop 配置 * @param weshopConfig weshop 配置 */ export declare function rewriteWeshopConfig(configPath: string, weshopConfig: Weshop.Config): Promise; export declare function getCurrentUrl(basePath: string): Promise; export declare function checkIsMainPackage(basePath: string): Promise; export declare function getPackageNameByUrl(url: string): string; interface GetDepPathOpts { filter?: (item: Weshop.Dependency) => boolean; } export declare function getDependenciesPath(options?: GetDepPathOpts): string[]; /** * 异步操作并发限制,先将操作分组,最后的结果再铺平 * @param arr 需要迭代的数组 * @param limit 并发限制数 * @param fn 迭代操作 */ export declare function asyncMapLimit(arr: T[], limit: number, fn: (item: T) => Promise): Promise<{}[]>; /** * 异步模拟睡眠 * @param ms 毫秒数 */ export declare function sleep(ms: number): Promise; /** * glob Promise 化 */ export declare const glob: typeof _glob.__promisify__; /** * 获取某个项目里面所有的 Page 页面 * wxml 可能为 template wxml,所以需要确认是否 js/wxml 都存在 * @param pagesDir pages 文件夹地址 * @param needDependency 是否需要包含依赖的页面 */ export declare function getPages(projectDir: string, needDependency?: boolean): Promise; export declare function getPlugins(projectDir: string): Promise; /** * 代码路径,不需要关心系统 * @param args 路径 */ export declare function pathJoin(...args: string[]): string; /** * 获取当前的 app.json,app.json 建议通过同步读取处理 * @param cwd 当前文件夹 */ export declare function getAppJson(filePath: string): Wechat.AppJson; /** * 修复跨平台时模块路径处理问题 * @param modulePath 模块路径 */ export declare function modulePath(modulePath: string): string; /** * 检查工具版本 */ export declare function checkVersion(checkVersion?: boolean): boolean; export declare function addCommonOption(program: program.CommanderStatic): void; export declare function getCommonOption(): { checkVersion: boolean; quiet: boolean; verbose: boolean; }; export declare function cat(filePath: string): Promise; export {}; //# sourceMappingURL=utils.d.ts.map