/** * Per-plugin cache for tsconfig path alias resolution. * * @remarks * The `ecopages-alias-resolver` plugin resolves project path aliases to * concrete file paths using the app's tsconfig `paths`. Each resolution goes * through oxc-resolver and may read barrel re-export targets. * * This cache memoizes the result keyed by `(projectRoot, specifier)`. It is * process-local and not currently invalidated by the file watcher — * project contents are assumed to be stable for the lifetime of the process. */ export declare class AliasResolverCache { private readonly entries; private readonly maxEntries; private hits; private misses; constructor(maxEntries?: number); /** * Look up a previously-computed resolution for `(srcDir, specifier)`. * * Returns `{ hit: true, resolved }` on cache hit (resolved may be * `undefined` for an unresolvable specifier), or `{ hit: false }` on * miss. The caller is responsible for re-running the resolver and * calling `set` to store the new entry. */ get(srcDir: string, specifier: string): { hit: true; resolved: string | undefined; } | { hit: false; }; /** * Store a resolution result. * * Pass `undefined` for `resolved` to memoize the negative case * (specifier did not resolve) and avoid repeating the FS walk on * every `@/...` import. */ set(srcDir: string, specifier: string, resolved: string | undefined): void; /** * Drop all entries whose `srcDir` is under `rootDir`. Use this from * the file watcher when files are added or removed under the app's * source tree. * * Path comparison is path-aware (handles both POSIX `/` and * Windows `\` separators) via `path.relative` so cached entries * normalized on one platform still match the watcher's `rootDir` * on another. Without this, a Windows build that sees * `entry.srcDir === 'C:\app\src'` would miss * `entry.srcDir.startsWith('C:/app/src/')` and leave stale entries. */ invalidateUnder(rootDir: string): number; /** Clear all entries. */ clear(): void; /** Current cache size. */ get size(): number; /** Hit/miss counters for observability. */ stats(): { hits: number; misses: number; size: number; hitRate: number; }; }