-
Notifications
You must be signed in to change notification settings - Fork 701
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
10 changed files
with
189 additions
and
11 deletions.
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
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
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,28 @@ | ||
--- | ||
title: "@class" | ||
--- | ||
|
||
# @class | ||
|
||
**Tag Kind:** [Modifier](../tags.md#Modifier-Tags) | ||
|
||
If present on a variable, will cause it to be converted as a class. This | ||
will result in all "dynamic" properties being expanded to real properties. | ||
|
||
TypeDoc will also ignore types/interfaces declared with the same name as | ||
variables annotated with `@class`. | ||
|
||
## Example | ||
|
||
```ts | ||
/** @class */ | ||
export function ClassLike() { | ||
if (new.target) { | ||
// | ||
} | ||
} | ||
``` | ||
|
||
## See Also | ||
|
||
- The [`@interface`](interface.md) tag |
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,52 @@ | ||
--- | ||
title: "@expand" | ||
--- | ||
|
||
# @expand | ||
|
||
**Tag Kind:** [Modifier](../tags.md#Modifier-Tags) | ||
|
||
The `@expand` tag may be placed on type aliases and interfaces. When a type is | ||
annotated with `@expand`, TypeDoc will inline the type declaration of that type | ||
wherever it is referenced and TypeDoc has a place to include it. | ||
|
||
> Note: Use of this tag can _significantly_ increase the size of your generated | ||
> documentation if it is applied to commonly used types as it will result in | ||
> inlining the comments for those types everywhere they are referenced. | ||
## Example | ||
|
||
This is particularly useful for React components, where the documentation for | ||
props is useful when viewing the component function. The `Hello` component below | ||
will take the description "Props docs" from `HelloProps` for its `props` | ||
parameter and also render details about the referenced type. | ||
|
||
The `Hello2` component behaves similarly, but provides a more relevant | ||
description for the overall type, which prevents the summary provided in | ||
`HelloProps` from being used. | ||
|
||
```tsx | ||
/** | ||
* Props docs | ||
* @expand | ||
*/ | ||
export type HelloProps = { | ||
/** Name property docs */ | ||
name: string; | ||
}; | ||
|
||
/** | ||
* Hello | ||
*/ | ||
export function Hello(props: HelloProps) { | ||
return {}; | ||
} | ||
|
||
/** | ||
* Hello2 | ||
* @param props Props docs (used instead of `@expand` description) | ||
*/ | ||
export function Hello2(props: HelloProps) { | ||
return {}; | ||
} | ||
``` |
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,29 @@ | ||
--- | ||
title: "@import" | ||
--- | ||
|
||
# @import | ||
|
||
**Tag Kind:** [Block](../tags.md#Block-Tags) | ||
|
||
The `@import` tag is recognized for use in JavaScript projects which can use it | ||
to declare type imports since TypeScript 5.5. Any comment containing `@import` | ||
will be ignored by TypeDoc. | ||
|
||
## Example | ||
|
||
Taken from the [TypeScript 5.5 release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-5.html#the-jsdoc-import-tag) | ||
|
||
```js | ||
/** @import { SomeType } from "some-module" */ | ||
/** | ||
* @param {SomeType} myValue | ||
*/ | ||
function doSomething(myValue) { | ||
// ... | ||
} | ||
``` | ||
|
||
## See Also | ||
|
||
- The [TypeScript 5.5 release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-5.html#the-jsdoc-import-tag) |
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,18 @@ | ||
--- | ||
title: "@license" | ||
--- | ||
|
||
# @license | ||
|
||
**Tag Kind:** [Block](../tags.md#Block-Tags) | ||
|
||
The `@license` tag is recognized to declare a license comment which should not | ||
be included in the documentation. Any comments containing `@license` will be | ||
excluded from the generated documentation. | ||
|
||
## Example | ||
|
||
```js | ||
/** @license Apache-2.0 */ | ||
export const api = {...} // not documented | ||
``` |
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,29 @@ | ||
--- | ||
title: "@summary" | ||
--- | ||
|
||
# @summary | ||
|
||
**Tag Kind:** [Block](../tags.md#Block-Tags) <br> | ||
**JSDoc Reference:** [@summary](https://jsdoc.app/tags-summary) | ||
|
||
When rendering modules, TypeDoc uses the first paragraph of comment's summary | ||
text (text before any [block tags](../tags.md#Block-Tags)) as the member's | ||
summary on the modules page. As this may not always be suitable for standalone | ||
display, if a `@summary` tag is present TypeDoc will render that block instead. | ||
|
||
## Example | ||
|
||
```ts | ||
/** | ||
* This description will be used on the **module** page | ||
*/ | ||
export function runProcess(): void; | ||
|
||
/** | ||
* This description will be used on the **member** page | ||
* @summary | ||
* This description will be used on the **module** page | ||
*/ | ||
export function forkProcess(): void; | ||
``` |
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
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
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