/** * Token Resolver * * Canonicalizes a DI token expression (the argument of @inject(...), @multiInject(...), * @provideSingletonDefaultForApi(...), or bind(...)) into a stable string key so that a token * DEFINITION (e.g. `TYPES.Counter` in one file) and its BIND SITE (e.g. * `bind(TYPES.Counter)` in another package) resolve to the same key. * * Key forms: * - Symbol.for('X') → "symbol.for:X" (global symbol registry — string key is identity) * - Symbol('X') → "symbol:#" (per-declaration identity) * - class-as-token → "class:#" (e.g. @inject(HeaderMethods), bind(X).toSelf()) * - anything else → "expr:#" (best-effort fallback) */ import * as ts from 'typescript'; import { TokenRef } from './model'; /** Workspace-relative posix path for a source file. */ export declare function relativeFile(workspaceRoot: string, sourceFile: ts.SourceFile): string; /** * Resolve a token expression to its canonical key + display text. * * Uses the type checker to follow the expression (identifier or property access, * possibly imported from another package) to its declaration, then inspects the * declaration's initializer for Symbol.for / Symbol calls. */ export declare function resolveTokenKey(expr: ts.Expression, checker: ts.TypeChecker, workspaceRoot: string): TokenRef; /** Build the class-as-token key for a class declaration (bind(X).toSelf(), @provideSingleton). */ export declare function classTokenKey(cls: ts.ClassDeclaration, workspaceRoot: string): TokenRef;