.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / @typescript-eslint / experimental-utils / dist / ts-eslint-scope / Scope.d.ts
1 import { TSESTree } from '../ts-estree';
2 import { Definition } from './Definition';
3 import { Reference, ReferenceFlag } from './Reference';
4 import { ScopeManager } from './ScopeManager';
5 import { Variable } from './Variable';
6 declare type ScopeType = 'block' | 'catch' | 'class' | 'for' | 'function' | 'function-expression-name' | 'global' | 'module' | 'switch' | 'with' | 'TDZ' | 'enum' | 'empty-function';
7 interface Scope {
8     type: ScopeType;
9     isStrict: boolean;
10     upper: Scope | null;
11     childScopes: Scope[];
12     variableScope: Scope;
13     block: TSESTree.Node;
14     variables: Variable[];
15     set: Map<string, Variable>;
16     references: Reference[];
17     through: Reference[];
18     thisFound?: boolean;
19     taints: Map<string, boolean>;
20     functionExpressionScope: boolean;
21     __left: Reference[];
22     __shouldStaticallyClose(scopeManager: ScopeManager): boolean;
23     __shouldStaticallyCloseForGlobal(ref: any): boolean;
24     __staticCloseRef(ref: any): void;
25     __dynamicCloseRef(ref: any): void;
26     __globalCloseRef(ref: any): void;
27     __close(scopeManager: ScopeManager): Scope;
28     __isValidResolution(ref: any, variable: any): variable is Variable;
29     __resolve(ref: Reference): boolean;
30     __delegateToUpperScope(ref: any): void;
31     __addDeclaredVariablesOfNode(variable: any, node: TSESTree.Node): void;
32     __defineGeneric(name: string, set: Map<string, Variable>, variables: Variable[], node: TSESTree.Identifier, def: Definition): void;
33     __define(node: TSESTree.Node, def: Definition): void;
34     __referencing(node: TSESTree.Node, assign?: ReferenceFlag, writeExpr?: TSESTree.Node, maybeImplicitGlobal?: any, partial?: any, init?: any): void;
35     __detectEval(): void;
36     __detectThis(): void;
37     __isClosed(): boolean;
38     /**
39      * returns resolved {Reference}
40      * @method Scope#resolve
41      * @param {Espree.Identifier} ident - identifier to be resolved.
42      * @returns {Reference} reference
43      */
44     resolve(ident: TSESTree.Node): Reference;
45     /**
46      * returns this scope is static
47      * @method Scope#isStatic
48      * @returns {boolean} static
49      */
50     isStatic(): boolean;
51     /**
52      * returns this scope has materialized arguments
53      * @method Scope#isArgumentsMaterialized
54      * @returns {boolean} arguments materialized
55      */
56     isArgumentsMaterialized(): boolean;
57     /**
58      * returns this scope has materialized `this` reference
59      * @method Scope#isThisMaterialized
60      * @returns {boolean} this materialized
61      */
62     isThisMaterialized(): boolean;
63     isUsedName(name: any): boolean;
64 }
65 interface ScopeConstructor {
66     new (scopeManager: ScopeManager, type: ScopeType, upperScope: Scope | null, block: TSESTree.Node | null, isMethodDefinition: boolean): Scope;
67 }
68 declare const Scope: ScopeConstructor;
69 interface ScopeChildConstructorWithUpperScope<T> {
70     new (scopeManager: ScopeManager, upperScope: Scope, block: TSESTree.Node | null): T;
71 }
72 interface GlobalScope extends Scope {
73 }
74 declare const GlobalScope: ScopeConstructor & (new (scopeManager: ScopeManager, block: TSESTree.Node | null) => GlobalScope);
75 interface ModuleScope extends Scope {
76 }
77 declare const ModuleScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<ModuleScope>;
78 interface FunctionExpressionNameScope extends Scope {
79 }
80 declare const FunctionExpressionNameScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<FunctionExpressionNameScope>;
81 interface CatchScope extends Scope {
82 }
83 declare const CatchScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<CatchScope>;
84 interface WithScope extends Scope {
85 }
86 declare const WithScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<WithScope>;
87 interface BlockScope extends Scope {
88 }
89 declare const BlockScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<BlockScope>;
90 interface SwitchScope extends Scope {
91 }
92 declare const SwitchScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<SwitchScope>;
93 interface FunctionScope extends Scope {
94 }
95 declare const FunctionScope: ScopeConstructor & (new (scopeManager: ScopeManager, upperScope: Scope, block: TSESTree.Node | null, isMethodDefinition: boolean) => FunctionScope);
96 interface ForScope extends Scope {
97 }
98 declare const ForScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<ForScope>;
99 interface ClassScope extends Scope {
100 }
101 declare const ClassScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<ClassScope>;
102 export { ScopeType, Scope, GlobalScope, ModuleScope, FunctionExpressionNameScope, CatchScope, WithScope, BlockScope, SwitchScope, FunctionScope, ForScope, ClassScope, };
103 //# sourceMappingURL=Scope.d.ts.map