-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
ClassBase.ts
74 lines (71 loc) · 2.43 KB
/
ClassBase.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import type { Identifier } from '../expression/Identifier/spec';
import type { ClassBody } from '../special/ClassBody/spec';
import type { Decorator } from '../special/Decorator/spec';
import type { TSClassImplements } from '../special/TSClassImplements/spec';
import type { TSTypeParameterDeclaration } from '../special/TSTypeParameterDeclaration/spec';
import type { TSTypeParameterInstantiation } from '../special/TSTypeParameterInstantiation/spec';
import type { LeftHandSideExpression } from '../unions/LeftHandSideExpression';
import type { BaseNode } from './BaseNode';
export interface ClassBase extends BaseNode {
/**
* Whether the class is an abstract class.
* ```
* abstract class Foo {...}
* ```
* This is always `undefined` for `ClassExpression`.
*/
// TODO(#5020) - make this `false` if it is not `abstract`
abstract?: boolean;
/**
* The class body.
*/
body: ClassBody;
/**
* Whether the class has been `declare`d:
* ```
* declare class Foo {...}
* ```
* This is always `undefined` for `ClassExpression`.
*/
// TODO(#5020) - make this `false` if it is not `declare`d
declare?: boolean;
/**
* The decorators declared for the class.
* This is `undefined` if there are no decorators.
* ```
* @deco
* class Foo {...}
* ```
* This is always `undefined` for `ClassExpression`.
*/
// TODO(#5020) - make this an empty array if there are none declared
decorators?: Decorator[];
/**
* The class's name.
* - For a `ClassExpression` this may be `null` if the name is omitted.
* - For a `ClassDeclaration` this may be `null` if and only if the parent is
* an `ExportDefaultDeclaration`.
*/
id: Identifier | null;
/**
* The implemented interfaces for the class.
* This is `undefined` if there are no implemented interfaces.
*/
implements?: TSClassImplements[];
/**
* The super class this class extends.
*/
superClass: LeftHandSideExpression | null;
/**
* The generic type parameters passed to the superClass.
* This is `undefined` if there are no generic type parameters passed.
*/
superTypeArguments?: TSTypeParameterInstantiation;
/** @deprecated Use {@link `superTypeArguments`} instead. */
superTypeParameters?: TSTypeParameterInstantiation;
/**
* The generic type parameters declared for the class.
* This is `undefined` if there are no generic type parameters declared.
*/
typeParameters?: TSTypeParameterDeclaration;
}