forked from typescript-eslint/typescript-eslint
-
Notifications
You must be signed in to change notification settings - Fork 1
/
spec.ts
36 lines (32 loc) · 1.01 KB
/
spec.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
import type { AST_NODE_TYPES } from '../../ast-node-types';
import type { Accessibility } from '../../base/Accessibility';
import type { BaseNode } from '../../base/BaseNode';
import type { TSTypeAnnotation } from '../../special/TSTypeAnnotation/spec';
import type {
PropertyName,
PropertyNameComputed,
PropertyNameNonComputed,
} from '../../unions/PropertyName';
interface TSPropertySignatureBase extends BaseNode {
type: AST_NODE_TYPES.TSPropertySignature;
key: PropertyName;
optional?: boolean;
computed: boolean;
typeAnnotation?: TSTypeAnnotation;
readonly?: boolean;
static?: boolean;
accessibility?: Accessibility;
}
export interface TSPropertySignatureComputedName
extends TSPropertySignatureBase {
key: PropertyNameComputed;
computed: true;
}
export interface TSPropertySignatureNonComputedName
extends TSPropertySignatureBase {
key: PropertyNameNonComputed;
computed: false;
}
export type TSPropertySignature =
| TSPropertySignatureComputedName
| TSPropertySignatureNonComputedName;