mp-lens
Version:
微信小程序分析工具 (Unused Code, Dependencies, Visualization)
13 lines (12 loc) • 617 B
TypeScript
/**
* Generates a canonical node ID and label from a file's absolute path.
* The ID is prefixed and relative to the miniapp root, ensuring uniqueness and consistency.
* @param type The type of the node ('Page' or 'Component').
* @param absolutePath The absolute path to one of the entity's files (e.g., .wxml, .json).
* @param miniappRoot The absolute path to the miniapp root directory.
* @returns An object containing the canonical id and label.
*/
export declare function generateNodeIdAndLabel(type: 'Page' | 'Component', absolutePath: string, miniappRoot: string): {
id: string;
label: string;
};