import { Entry, Options } from '@nodelib/fs.walk'; export type ImportStatement = { library: string; default?: string; bindings?: string[]; file?: string; pos: number; end: number; }; /** * 解析代码中的import语句 */ export declare const parseImportNames: (sourceCode: string, file?: string) => ImportStatement[]; export type FileImport = { file: string; imports: ImportStatement[]; }; /** * 遍历文件夹下所有文件,提取所有import语句 */ export declare function getImports(dirPath: string): Promise; export declare function getImports(dirPath: string, fliter: (entry: Entry) => boolean): Promise; export declare function getImports(dirPath: string, fliter: (entry: Entry) => boolean, flatImports: true): Promise; export declare function getImports(dirPath: string, fliter: (entry: Entry) => boolean, flatImports: true, ops: Options): Promise; export declare function getImports(dirPath: string, fliter: (entry: Entry) => boolean, flatImports: false): Promise; export declare function getImports(dirPath: string, fliter: (entry: Entry) => boolean, flatImports: false, ops: Options): Promise;