mp-lens
Version:
微信小程序分析工具 (Unused Code, Dependencies, Visualization)
36 lines (35 loc) • 996 B
TypeScript
export type NodeType = 'App' | 'Package' | 'Page' | 'Component' | 'Module';
export type LinkType = 'Structure' | 'Import' | 'Style' | 'Template' | 'Config' | 'Resource' | 'WorkerEntry';
export interface GraphNode {
id: string;
type: NodeType;
label: string;
properties?: {
absolutePath?: string;
basePath?: string;
root?: string;
path?: string;
fileSize?: number;
fileExt?: string;
fileCount?: number;
totalSize?: number;
fileTypes?: Record<string, number>;
sizeByType?: Record<string, number>;
structuralParentId?: string;
referredBy?: string[];
[key: string]: any;
};
}
export interface GraphLink {
source: string;
target: string;
type: LinkType;
dependencyType?: string;
properties?: Record<string, any>;
}
export interface ProjectStructure {
nodes: GraphNode[];
links: GraphLink[];
rootNodeId: string | null;
miniappRoot: string;
}