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 | scope: Scope;
|
35 | identifiers: estree.Identifier[];
|
36 | references: Reference[];
|
37 | defs: eslint.Scope.Definition[];
|
38 | }
|
39 |
|
40 | export class Reference implements eslint.Scope.Reference {
|
41 | identifier: estree.Identifier;
|
42 | from: Scope;
|
43 | resolved: Variable | null;
|
44 | writeExpr: estree.Node | null;
|
45 | init: boolean;
|
46 |
|
47 | isWrite(): boolean;
|
48 | isRead(): boolean;
|
49 | isWriteOnly(): boolean;
|
50 | isReadOnly(): boolean;
|
51 | isReadWrite(): boolean;
|
52 | }
|
53 |
|
54 | export interface AnalysisOptions {
|
55 | optimistic?: boolean;
|
56 | directive?: boolean;
|
57 | ignoreEval?: boolean;
|
58 | nodejsScope?: boolean;
|
59 | impliedStrict?: boolean;
|
60 | fallback?: string | ((node: {}) => string[]);
|
61 | sourceType?: "script" | "module";
|
62 | ecmaVersion?: number;
|
63 | }
|
64 |
|
65 | export function analyze(ast: {}, options?: AnalysisOptions): ScopeManager;
|
66 |
|
\ | No newline at end of file |