Skip to content

Commit 8028813

Browse files
feat(website): render @defaultValue blocks (#8527)
feat(website): render @DefaultValue blocks
1 parent 47f2990 commit 8028813

File tree

5 files changed

+30
-24
lines changed

5 files changed

+30
-24
lines changed

packages/rest/src/lib/CDN.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface BaseImageURLOptions {
1515
/**
1616
* The extension to use for the image URL
1717
*
18-
* @default 'webp'
18+
* @defaultValue `'webp'`
1919
*/
2020
extension?: ImageExtension;
2121
/**
@@ -41,7 +41,7 @@ export interface MakeURLOptions {
4141
/**
4242
* The extension to use for the image URL
4343
*
44-
* @default 'webp'
44+
* @defaultValue `'webp'`
4545
*/
4646
extension?: string | undefined;
4747
/**

packages/rest/src/lib/REST.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,45 +25,45 @@ export interface RESTOptions {
2525
agent: Dispatcher;
2626
/**
2727
* The base api path, without version
28-
* @default 'https://discord.com/api'
28+
* @defaultValue `'https://discord.com/api'`
2929
*/
3030
api: string;
3131
/**
3232
* The authorization prefix to use for requests, useful if you want to use
3333
* bearer tokens
3434
*
35-
* @default 'Bot'
35+
* @defaultValue `'Bot'`
3636
*/
3737
authPrefix: 'Bot' | 'Bearer';
3838
/**
3939
* The cdn path
4040
*
41-
* @default 'https://cdn.discordapp.com'
41+
* @defaultValue 'https://cdn.discordapp.com'
4242
*/
4343
cdn: string;
4444
/**
4545
* Additional headers to send for all API requests
4646
*
47-
* @default {}
47+
* @defaultValue `{}`
4848
*/
4949
headers: Record<string, string>;
5050
/**
5151
* The number of invalid REST requests (those that return 401, 403, or 429) in a 10 minute window between emitted warnings (0 for no warnings).
5252
* That is, if set to 500, warnings will be emitted at invalid request number 500, 1000, 1500, and so on.
5353
*
54-
* @default 0
54+
* @defaultValue `0`
5555
*/
5656
invalidRequestWarningInterval: number;
5757
/**
5858
* How many requests to allow sending per second (Infinity for unlimited, 50 for the standard global limit used by Discord)
5959
*
60-
* @default 50
60+
* @defaultValue `50`
6161
*/
6262
globalRequestsPerSecond: number;
6363
/**
6464
* The extra offset to add to rate limits in milliseconds
6565
*
66-
* @default 50
66+
* @defaultValue `50`
6767
*/
6868
offset: number;
6969
/**
@@ -72,50 +72,50 @@ export interface RESTOptions {
7272
* (e.g. `/channels` to match any route starting with `/channels` such as `/channels/:id/messages`)
7373
* for which to throw {@link RateLimitError}s. All other request routes will be queued normally
7474
*
75-
* @default null
75+
* @defaultValue `null`
7676
*/
7777
rejectOnRateLimit: string[] | RateLimitQueueFilter | null;
7878
/**
7979
* The number of retries for errors with the 500 code, or errors
8080
* that timeout
8181
*
82-
* @default 3
82+
* @defaultValue `3`
8383
*/
8484
retries: number;
8585
/**
8686
* The time to wait in milliseconds before a request is aborted
8787
*
88-
* @default 15_000
88+
* @defaultValue `15_000`
8989
*/
9090
timeout: number;
9191
/**
9292
* Extra information to add to the user agent
9393
*
94-
* @default `Node.js ${process.version}`
94+
* @defaultValue ``Node.js ${process.version}``
9595
*/
9696
userAgentAppendix: string;
9797
/**
9898
* The version of the API to use
9999
*
100-
* @default '10'
100+
* @defaultValue `'10'`
101101
*/
102102
version: string;
103103
/**
104104
* The amount of time in milliseconds that passes between each hash sweep. (defaults to 4h)
105105
*
106-
* @default 14_400_000
106+
* @defaultValue `14_400_000`
107107
*/
108108
hashSweepInterval: number;
109109
/**
110110
* The maximum amount of time a hash can exist in milliseconds without being hit with a request (defaults to 24h)
111111
*
112-
* @default 86_400_000
112+
* @defaultValue `86_400_000`
113113
*/
114114
hashLifetime: number;
115115
/**
116116
* The amount of time in milliseconds that passes between each hash sweep. (defaults to 1h)
117117
*
118-
* @default 3_600_000
118+
* @defaultValue `3_600_000`
119119
*/
120120
handlerSweepInterval: number;
121121
}

packages/rest/src/lib/RequestManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ export interface RequestData {
5050
/**
5151
* If this request needs the `Authorization` header
5252
*
53-
* @default true
53+
* @defaultValue `true`
5454
*/
5555
auth?: boolean;
5656
/**
5757
* The authorization prefix to use for this request, useful if you use this with bearer tokens
5858
*
59-
* @default 'Bot'
59+
* @defaultValue `'Bot'`
6060
*/
6161
authPrefix?: 'Bot' | 'Bearer';
6262
/**
@@ -92,7 +92,7 @@ export interface RequestData {
9292
/**
9393
* If this request should be versioned
9494
*
95-
* @default true
95+
* @defaultValue `true`
9696
*/
9797
versioned?: boolean;
9898
}

packages/website/src/components/tsdoc/BlockComment.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ export function DeprecatedBlock({ children }: { children: ReactNode }): JSX.Elem
4040
);
4141
}
4242

43+
export function DefaultValueBlock({ children }: { children: ReactNode }): JSX.Element {
44+
return <Block title="Default value">{children}</Block>;
45+
}
46+
4347
export function RemarksBlock({ children }: { children: ReactNode }): JSX.Element {
4448
return <Block title="Remarks">{children}</Block>;
4549
}
@@ -52,6 +56,8 @@ export function BlockComment({ children, tagName, index }: BlockCommentProps): J
5256
return <DeprecatedBlock>{children}</DeprecatedBlock>;
5357
case StandardTags.remarks.tagNameWithUpperCase:
5458
return <RemarksBlock>{children}</RemarksBlock>;
59+
case StandardTags.defaultValue.tagNameWithUpperCase:
60+
return <DefaultValueBlock>{children}</DefaultValueBlock>;
5561
case StandardTags.typeParam.tagNameWithUpperCase:
5662
case StandardTags.param.tagNameWithUpperCase:
5763
return <Text>{children}</Text>;

packages/ws/src/ws/WebSocketManager.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,17 +112,17 @@ export interface OptionalWebSocketManagerOptions {
112112
identifyProperties: GatewayIdentifyProperties;
113113
/**
114114
* The gateway version to use
115-
* @default '10'
115+
* @defaultValue `'10'`
116116
*/
117117
version: string;
118118
/**
119119
* The encoding to use
120-
* @default 'json'
120+
* @defaultValue `'json'`
121121
*/
122122
encoding: Encoding;
123123
/**
124124
* The compression method to use
125-
* @default null (no compression)
125+
* @defaultValue `null` (no compression)
126126
*/
127127
compression: CompressionMethod | null;
128128
/**
@@ -187,7 +187,7 @@ export class WebSocketManager extends AsyncEventEmitter<ManagerShardEventsMap> {
187187

188188
/**
189189
* Strategy used to manage shards
190-
* @default SimpleManagerToShardStrategy
190+
* @defaultValue `SimpleManagerToShardStrategy`
191191
*/
192192
private strategy: IShardingStrategy = new SimpleShardingStrategy(this);
193193

0 commit comments

Comments
 (0)