import ts from "typescript"; export interface ScopeNode { readonly id: number; readonly parentId: number | undefined; readonly start: number; readonly end: number; /** Depth from the source-file scope (0). */ readonly depth: number; /** Kind — used for var-hoisting and function-name binding. */ readonly kind: ScopeKind; } export type ScopeKind = "source" | "function" | "class" | "block" | "module" | "catch" | "for" | "case"; export interface ScopeTable { readonly scopes: readonly ScopeNode[]; /** Scope that lexically contains `position` (innermost). */ scopeAt(position: number): ScopeNode; /** Ancestor chain from innermost to root. */ ancestors(scopeId: number): readonly ScopeNode[]; /** Nearest function-like or source scope (for `var` hoisting). */ functionScope(scopeId: number): ScopeNode; /** * Declaration scope for a binding name node. * Handles function-declaration names (bind in parent) and `var` hoisting. */ declarationScope(nameNode: ts.Node, sourceFile: ts.SourceFile, flags?: { readonly isVar?: boolean; }): ScopeNode; } /** * Build a lightweight lexical scope table for one SourceFile. * Not a full TS checker — block/function/module/catch/for only. */ export declare function buildScopeTable(sourceFile: ts.SourceFile): ScopeTable; //# sourceMappingURL=scopes.d.ts.map