import { Common, SDK } from '@rsdoctor/types'; import { TreeNodeProps, UploadFile } from 'antd'; import { FieldDataNode } from 'rc-tree'; export type DataNode = FieldDataNode<{ key: string | number; title?: React.ReactNode | ((data: DataNode) => React.ReactNode); }> & { __BASENAME__?: any; __RESOURCEPATH__?: any; children?: DataNode[]; }; export declare const rootDirname: (file: string, sep?: string) => string | null; export declare function mapFileKey(arr: DataNode[], depth?: number, filter?: (node: DataNode) => boolean): DataNode['key'][]; export declare function flattenDirectory(n: DataNode, parent: DataNode, sep: string | undefined, inlinedResourcePathKey: keyof DataNode, dirTitle?: (_dir: DataNode, defaultTitle: string) => React.JSX.Element | string): void; export declare function createFileStructures({ files, inlinedResourcePathKey, fileTitle, dirTitle, page, }: { files: string[]; cwd?: string; inlinedResourcePathKey?: keyof DataNode; dirTitle?(dir: DataNode, defaultTitle: string): React.JSX.Element | string; fileTitle?(file: string, basename: string): React.JSX.Element | string; page?: 'bundle' | 'other'; }): DataNode[]; export declare function beautifyPath(path: string, cwd: string): string; export declare function readJSONByFileReader(file: UploadFile): Promise; export declare function readJSONByFileReader(file: Blob): Promise; /** * beautify module path, will replace cwd & last 'node_modules' */ export declare function beautifyModulePath(modulePath: string, cwd: string): { alias: string; inNodeModules: boolean; }; export declare function getFileIcon(props: TreeNodeProps, addRowIcon?: boolean): import("react").JSX.Element; type TreeNode = { name: string; value?: number; children?: TreeNode[]; path?: string; sourceSize?: number; bundledSize?: number; gzipSize?: number; id?: string | number; _map?: Map; }; export declare function buildTreemapData(modules: SDK.ModuleData[], rootName?: string): TreeNode; export declare function flattenTreemapData(modules: SDK.ModuleData[], rootName?: string): TreeNode; export {};