/
Reference.ts
42 lines (36 loc) · 941 Bytes
/
Reference.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { TSESTree } from '@typescript-eslint/typescript-estree';
import ESLintReference from 'eslint-scope/lib/reference';
import { Scope } from './Scope';
import { Variable } from './Variable';
export type ReferenceFlag = 0x1 | 0x2 | 0x3;
interface Reference {
identifier: TSESTree.Identifier;
from: Scope;
resolved: Variable | null;
writeExpr: TSESTree.Node | null;
init: boolean;
partial: boolean;
__maybeImplicitGlobal: boolean;
tainted?: boolean;
typeMode?: boolean;
isWrite(): boolean;
isRead(): boolean;
isWriteOnly(): boolean;
isReadOnly(): boolean;
isReadWrite(): boolean;
}
const Reference = ESLintReference as {
new (
identifier: TSESTree.Identifier,
scope: Scope,
flag?: ReferenceFlag,
writeExpr?: TSESTree.Node | null,
maybeImplicitGlobal?: boolean,
partial?: boolean,
init?: boolean,
): Reference;
READ: 0x1;
WRITE: 0x2;
RW: 0x3;
};
export { Reference };