1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | import * as eslint from "eslint";
|
7 | import * as estree from "estree";
|
8 |
|
9 | export const version: string;
|
10 |
|
11 | export class ScopeManager implements eslint.Scope.ScopeManager {
|
12 | scopes: Scope[];
|
13 | globalScope: Scope;
|
14 | acquire(node: {}, inner?: boolean): Scope | null;
|
15 | getDeclaredVariables(node: {}): Variable[];
|
16 | }
|
17 |
|
18 | export class Scope implements eslint.Scope.Scope {
|
19 | type: "block" | "catch" | "class" | "for" | "function" | "function-expression-name" | "global" | "module" | "switch" | "with" | "TDZ";
|
20 | isStrict: boolean;
|
21 | upper: Scope | null;
|
22 | childScopes: Scope[];
|
23 | variableScope: Scope;
|
24 | block: estree.Node;
|
25 | variables: Variable[];
|
26 | set: Map<string, Variable>;
|
27 | references: Reference[];
|
28 | through: Reference[];
|
29 | functionExpressionScope: boolean;
|
30 | }
|
31 |
|
32 | export class Variable implements eslint.Scope.Variable {
|
33 | name: string;
|
34 | identifiers: estree.Identifier[];
|
35 | references: Reference[];
|
36 | defs: eslint.Scope.Definition[];
|
37 | }
|
38 |
|
39 | export class Reference implements eslint.Scope.Reference {
|
40 | identifier: estree.Identifier;
|
41 | from: Scope;
|
42 | resolved: Variable | null;
|
43 | writeExpr: estree.Node | null;
|
44 | init: boolean;
|
45 |
|
46 | isWrite(): boolean;
|
47 | isRead(): boolean;
|
48 | isWriteOnly(): boolean;
|
49 | isReadOnly(): boolean;
|
50 | isReadWrite(): boolean;
|
51 | }
|
52 |
|
53 | export interface AnalysisOptions {
|
54 | optimistic?: boolean;
|
55 | directive?: boolean;
|
56 | ignoreEval?: boolean;
|
57 | nodejsScope?: boolean;
|
58 | impliedStrict?: boolean;
|
59 | fallback?: string | ((node: {}) => string[]);
|
60 | sourceType?: "script" | "module";
|
61 | ecmaVersion?: number;
|
62 | }
|
63 |
|
64 | export function analyze(ast: {}, options?: AnalysisOptions): ScopeManager;
|
65 |
|
\ | No newline at end of file |