-
Notifications
You must be signed in to change notification settings - Fork 171
/
declarations.ts
97 lines (87 loc) · 1.99 KB
/
declarations.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
export const stringConstWithDefaultValue = 'hello';
export let stringLetWithDefaultValue = 'hello';
stringLetWithDefaultValue = 'world';
export let undefinedNumberDeclaration: number;
/**
* @param objectLiteralDeclaration.valueX description for valueX
* @param objectLiteralDeclaration.valueZ description for valueZ
* @param objectLiteralDeclaration.valueY description for valueY
*/
export const objectLiteralDeclaration = {
/**
* Comment for valueZ
*/
valueZ: 'foo',
/**
* Comment for value Y
*/
valueY: function () {
return 'foo';
},
/**
* Comment for valueX
*/
valueX: {
valueZ: 'foo',
valueA: [100, 200, 300],
},
/**
* Comment for valueA
*/
valueA: 100,
valueB: true,
valueC: {},
};
export let typeLiteralDeclaration: {
/**
* Comment for valueZ
*/
valueZ: string;
valueY: { (): string };
/**
* Comment for valueX
*/
valueX: {
/**
* Nested comment for valueZ
*/
valueZ: string;
valueY: { (z: string): { a: string; b: string } };
valueA: number[];
};
/**
* Comments for valueA
*/
valueA?: number;
valueB?: boolean;
valueC: { [dataId: string]: 'ok' | 'ko' }
};
export let functionDeclaration: (someArg: number) => boolean;
export let callableDeclaration: {
(someArg: number): boolean;
arg1: string;
arg2: number;
};
export let indexableDeclaration: {
[index: number]: string;
arg1: string;
};
/**
* Comments
* @param {Object} objectLiteralAsConstDeclaration - Comment for object.
* @param {string} objectLiteralAsConstDeclaration.Prop1 - Comment for Prop1.
* @param {string} objectLiteralAsConstDeclaration.Prop2 - Comment for Prop2.
*/
export const objectLiteralAsConstDeclaration = {
Prop1: 'Prop1',
Prop2: 'Prop2',
Prop3: 'Prop3',
} as const;
export const __DOUBLE_UNDERSCORES_DECLARATION__ = Symbol.for('__type__');
export type AnyFunctionType<A = any> = (...input: any[]) => A;
export enum EnumDeclarations {
Up = 'UP',
Down = 'DOWN',
Left = 'LEFT',
Right = 'RIGHT',
}