/** * Name path utilities for parsing and matching hierarchical symbol paths. * * Name path format: * - "/ClassName/methodName" - Absolute path (must match from root) * - "ClassName/methodName" - Relative path (matches any suffix) * - "methodName" - Simple name (matches any symbol with that name) * - "Class/get*" - With glob pattern (substring matching on last element) * * Uses "/" as separator to match Serena's convention. */ /** * Parsed name path pattern for matching. */ export interface ParsedNamePath { /** Whether the path is absolute (starts with /) */ isAbsolute: boolean; /** Path segments */ segments: string[]; /** Whether to use substring matching on last segment */ substringMatch: boolean; /** Optional overload index (e.g., [0], [1]) */ overloadIndex?: number; } /** * Parse a name path pattern into its components. * * @param pattern - The name path pattern to parse * @returns Parsed pattern components * * @example * parseNamePath("/MyClass/myMethod") // absolute path * parseNamePath("MyClass/myMethod") // relative path * parseNamePath("myMethod") // simple name * parseNamePath("MyClass/get*") // with glob * parseNamePath("MyClass/method[0]") // with overload index */ export declare function parseNamePath(pattern: string): ParsedNamePath; /** * Build a name path from parent path and name. * * @param parentPath - Parent symbol's name path (or undefined for top-level) * @param name - Symbol's name * @returns Complete name path * * @example * buildNamePath(undefined, "MyClass") // "/MyClass" * buildNamePath("/MyClass", "myMethod") // "/MyClass/myMethod" */ export declare function buildNamePath(parentPath: string | undefined, name: string): string; /** * Check if a name path matches a pattern. * * @param namePath - The full name path of a symbol (e.g., "/MyClass/myMethod") * @param pattern - The parsed pattern to match against * @param useSubstringMatching - Override substring matching for last segment * @returns True if the name path matches the pattern * * @example * // Absolute match * matchNamePath("/MyClass/myMethod", parseNamePath("/MyClass/myMethod")) // true * matchNamePath("/MyClass/myMethod", parseNamePath("/OtherClass/myMethod")) // false * * // Relative match (suffix) * matchNamePath("/MyClass/myMethod", parseNamePath("myMethod")) // true * matchNamePath("/MyClass/myMethod", parseNamePath("MyClass/myMethod")) // true * * // Substring match * matchNamePath("/MyClass/getValue", parseNamePath("get*")) // true */ export declare function matchNamePath(namePath: string, pattern: ParsedNamePath, useSubstringMatching?: boolean): boolean; /** * Extract the last segment (symbol name) from a name path. * * @param namePath - Full name path * @returns The last segment (symbol name) * * @example * getSymbolName("/MyClass/myMethod") // "myMethod" * getSymbolName("/topLevelFunc") // "topLevelFunc" */ export declare function getSymbolName(namePath: string): string; /** * Get the parent path from a name path. * * @param namePath - Full name path * @returns Parent path, or undefined if top-level * * @example * getParentPath("/MyClass/myMethod") // "/MyClass" * getParentPath("/topLevelFunc") // undefined */ export declare function getParentPath(namePath: string): string | undefined; /** * Get the depth of a name path (number of segments - 1). * * @param namePath - Full name path * @returns Depth (0 for top-level) * * @example * getNamePathDepth("/topLevel") // 0 * getNamePathDepth("/MyClass/myMethod") // 1 */ export declare function getNamePathDepth(namePath: string): number; /** * Create a display-friendly version of a name path. * Removes the leading slash for cleaner display. * * @param namePath - Full name path * @returns Display string */ export declare function formatNamePath(namePath: string): string; //# sourceMappingURL=name-path.d.ts.map