forked from TypeStrong/typedoc
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// Don't reorder! | ||
// Order matters! | ||
export * from "./functions"; | ||
export * from "./variables"; | ||
export * from "./types"; | ||
export * from "./enums"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 [[`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; | ||
} |