Urara-Blog/node_modules/.pnpm-store/v3/files/ec/923dafc30f98449d6f3736dcf1c65bf4689bb1fbf586b7c3546916b7c2aa4729e5b3eb4af4b4bed429e3fd81db1e6fe90e780e5e6bd7a6ec9c2e9aa47c1425
2022-08-14 01:14:53 +08:00

30 lines
847 B
Text

import * as ts from 'typescript';
export interface VariableInfo {
domain: DeclarationDomain;
exported: boolean;
uses: VariableUse[];
inGlobalScope: boolean;
declarations: ts.Identifier[];
}
export interface VariableUse {
domain: UsageDomain;
location: ts.Identifier;
}
export declare enum DeclarationDomain {
Namespace = 1,
Type = 2,
Value = 4,
Import = 8,
Any = 7
}
export declare enum UsageDomain {
Namespace = 1,
Type = 2,
Value = 4,
ValueOrNamespace = 5,
Any = 7,
TypeQuery = 8
}
export declare function getUsageDomain(node: ts.Identifier): UsageDomain | undefined;
export declare function getDeclarationDomain(node: ts.Identifier): DeclarationDomain | undefined;
export declare function collectVariableUsage(sourceFile: ts.SourceFile): Map<ts.Identifier, VariableInfo>;