forked from typescript-eslint/typescript-eslint
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MethodDefinitionBase.ts
41 lines (37 loc) · 1.34 KB
/
MethodDefinitionBase.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
import type { FunctionExpression } from '../expression/FunctionExpression/spec';
import type { TSEmptyBodyFunctionExpression } from '../expression/TSEmptyBodyFunctionExpression/spec';
import type { Decorator } from '../special/Decorator/spec';
import type {
ClassPropertyNameNonComputed,
PropertyName,
PropertyNameComputed,
PropertyNameNonComputed,
} from '../unions/PropertyName';
import type { Accessibility } from './Accessibility';
import type { BaseNode } from './BaseNode';
/** this should not be directly used - instead use MethodDefinitionComputedNameBase or MethodDefinitionNonComputedNameBase */
interface MethodDefinitionBase extends BaseNode {
key: PropertyName;
value: FunctionExpression | TSEmptyBodyFunctionExpression;
computed: boolean;
static: boolean;
kind: 'constructor' | 'get' | 'method' | 'set';
optional: boolean;
decorators: Decorator[];
accessibility: Accessibility | undefined;
override: boolean;
}
export interface MethodDefinitionComputedNameBase extends MethodDefinitionBase {
key: PropertyNameComputed;
computed: true;
}
export interface MethodDefinitionNonComputedNameBase
extends MethodDefinitionBase {
key: PropertyNameNonComputed;
computed: false;
}
export interface ClassMethodDefinitionNonComputedNameBase
extends MethodDefinitionBase {
key: ClassPropertyNameNonComputed;
computed: false;
}