-
-
Notifications
You must be signed in to change notification settings - Fork 724
/
Copy pathtypes.ts
43 lines (37 loc) · 1.06 KB
/
types.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
/** A simple type alias defined using the `type` keyword. */
export type SimpleTypeAlias = string | number | boolean;
/** A complex generic type. */
export type ComplexGenericTypeAlias<T> =
| T
| T[]
| Promise<T>
| Promise<T[]>
| Record<string, Promise<T>>;
/**
* A simple interface. Each property has its own doc comment.
*
* TypeDoc even supports doc comments on nested type definitions, as shown by the `name` property.
*/
export interface User {
/** The user's ID. */
id: number;
/** The user's email address. */
email: string;
/** The user's name. */
name: {
/** The person's given name. */
first: string;
/** The person's family name. */
last: string;
};
}
/**
* An interface that extends {@link User | `User`} and adds more properties.
*
* Notice how TypeDoc automatically shows the inheritance hierarchy and where
* each property was originally defined.
*/
export interface AdminUser extends User {
administrativeArea: "sales" | "delivery" | "billing";
jobTitle: string;
}