UNPKG

877 BTypeScriptView Raw
1import * as ts from 'typescript';
2export interface VariableInfo {
3 domain: DeclarationDomain;
4 exported: boolean;
5 uses: VariableUse[];
6 inGlobalScope: boolean;
7 declarations: ts.Identifier[];
8}
9export interface VariableUse {
10 domain: UsageDomain;
11 location: ts.Identifier;
12}
13export declare enum DeclarationDomain {
14 Namespace = 1,
15 Type = 2,
16 Value = 4,
17 Import = 8,
18 Any = 7
19}
20export declare enum UsageDomain {
21 Namespace = 1,
22 Type = 2,
23 Value = 4,
24 ValueOrNamespace = 5,
25 Any = 7,
26 TypeQuery = 8
27}
28export declare function getUsageDomain(node: ts.Identifier): UsageDomain | undefined;
29export declare function getDeclarationDomain(node: ts.Identifier): DeclarationDomain | undefined;
30export declare function collectVariableUsage(sourceFile: ts.SourceFile): Map<ts.Identifier, VariableInfo>;