/** * transform svg to js object * @param {string} svg - svg file content * @param {string} name - svg filename * @param {string} theme - svg theme */ export declare function svg2asn(svg: string, name: string, theme: string): Promise; /** * generate asn file content that prepare write to local file * @param {string} asn - svg2asn 转换得到的 asn * @param {boolean} [typescript=true] - 是否生成 ts 文件 * @example * */ export declare function createAsnFileContent(asn: string, { name, theme, typescript, }: { name: string; theme: string; typescript?: boolean; }): string; interface ASNGeneratorOptions { /** * 外部传入的 SVG 文件名,优先使用该字段生成 ASN identifier */ name?: string; /** * 外部传入的 SVG 主题,优先使用该字段生成 ASN identifier */ theme?: string; /** * 是否生成 ts 文件 */ typescript?: boolean; /** * 如何从 SVG 文件路径生成 name 与 theme */ parser?: (id: string) => { name: string; theme: string; }; /** * 是否生成更多信息 */ verbose?: boolean; } export interface ASNNode { /** * 根据 name 和 theme 生成的组件名 */ identifier: string; /** * ASN 文件名 */ filename: string; /** * 生成该 ASN 的 SVG 文件名 */ name: string; /** * 生成该 ASN 的 SVG 主题 */ theme: string; /** * ASN 文件内容 */ content: string; } /** * SVG2ASN * @param {string} content - svg content * @param {string} id - svg filepath * @param {boolean} params.typescript * @returns */ export declare function ASNNodeTransformer(content: string, id: string, { name: n, theme: t, typescript, parser, verbose }: ASNGeneratorOptions): Promise; /** * generate src/index.ts file * @example * ['../asn/outlined/like'] * export { default as LikeOutlined } from '../asn/outlined/like'; */ export declare function entryRenderer(files: T[], { parse, }: { parse: (file: T) => { identifier: string; path: string; }; }): string; interface ASNOutputTransformerOptions { /** * SVG 文件入口 */ entry?: string; /** * 读取到的所有 SVG 路径与内容的列表 */ SVGFiles: { filepath: string; content: string; }[]; /** * ASN 文件输出目录 * 如指定 /output,将会输出 /output/asn/LikeOutlined.ts 目录结构 */ output?: string; /** * 生成 typescript 还是 javascript 文件 */ typescript?: boolean; /** * 输出的 ASN 文件夹名 * 如指定 /abc,将会输出 /output/abc/LikeOutlined.ts 目录结构 * @default 'asn' */ ASNDirName?: string; /** * 是否输出更多信息 */ verbose?: boolean; } /** * 批量转换 svg 文件成 js/ts 文件 */ export declare function ANSOutputTransformer({ SVGFiles, typescript, ASNDirName, verbose, }: ASNOutputTransformerOptions): Promise<{ entryFile: { filename: string; content: string; }; ASNNodes: ASNNode[]; }>; interface ReactIconTransformerOptions extends Pick { identifier: string; } /** * 从 asn 生成单个 react icon 组件 */ export declare function reactIconTransformer({ ASNFilepath, identifier, typescript, }: ReactIconTransformerOptions): { filename: string; identifier: string; content: string; }; interface ReactIconsOutputTransformerOptions { /** * ASN 文件路径 * 如 ../asn,将会生成 import LikeOutlined from '../asn/LikeOutlined'; 内容 */ ASNFilepath: string; ASNNodes: ASNNode[]; iconsDirName?: string; typescript?: boolean; } /** * React Icon 组件转换器 */ export declare function reactIconsOutputTransformer({ ASNNodes, ASNFilepath, iconsDirName, typescript, }: ReactIconsOutputTransformerOptions): Promise<{ entryFile: { filename: string; content: string; }; icons: { filename: string; identifier: string; content: string; }[]; }>; export {};