@discordjs/formatters 1.0.0-dev.1690416583-8f4256d.0 → 1.0.0-dev.1732752782-e89c6b66a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,12 +23,13 @@
23
23
 
24
24
  ## Installation
25
25
 
26
- **Node.js 16.9.0 or newer is required.**
26
+ **Node.js 20 or newer is required.**
27
27
 
28
28
  ```sh
29
29
  npm install @discordjs/formatters
30
30
  yarn add @discordjs/formatters
31
31
  pnpm add @discordjs/formatters
32
+ bun add @discordjs/formatters
32
33
  ```
33
34
 
34
35
  ## Example usage
package/dist/index.d.mts CHANGED
@@ -173,77 +173,85 @@ declare function escapeMaskedLink(text: string): string;
173
173
  /**
174
174
  * Wraps the content inside a code block with no language.
175
175
  *
176
- * @typeParam C - This is inferred by the supplied content
176
+ * @typeParam Content - This is inferred by the supplied content
177
177
  * @param content - The content to wrap
178
178
  */
179
- declare function codeBlock<C extends string>(content: C): `\`\`\`\n${C}\n\`\`\``;
179
+ declare function codeBlock<Content extends string>(content: Content): `\`\`\`\n${Content}\n\`\`\``;
180
180
  /**
181
181
  * Wraps the content inside a code block with the specified language.
182
182
  *
183
- * @typeParam L - This is inferred by the supplied language
184
- * @typeParam C - This is inferred by the supplied content
183
+ * @typeParam Language - This is inferred by the supplied language
184
+ * @typeParam Content - This is inferred by the supplied content
185
185
  * @param language - The language for the code block
186
186
  * @param content - The content to wrap
187
187
  */
188
- declare function codeBlock<L extends string, C extends string>(language: L, content: C): `\`\`\`${L}\n${C}\n\`\`\``;
188
+ declare function codeBlock<Language extends string, Content extends string>(language: Language, content: Content): `\`\`\`${Language}\n${Content}\n\`\`\``;
189
189
  /**
190
190
  * Wraps the content inside \`backticks\` which formats it as inline code.
191
191
  *
192
- * @typeParam C - This is inferred by the supplied content
192
+ * @typeParam Content - This is inferred by the supplied content
193
193
  * @param content - The content to wrap
194
194
  */
195
- declare function inlineCode<C extends string>(content: C): `\`${C}\``;
195
+ declare function inlineCode<Content extends string>(content: Content): `\`${Content}\``;
196
196
  /**
197
197
  * Formats the content into italic text.
198
198
  *
199
- * @typeParam C - This is inferred by the supplied content
199
+ * @typeParam Content - This is inferred by the supplied content
200
200
  * @param content - The content to wrap
201
201
  */
202
- declare function italic<C extends string>(content: C): `_${C}_`;
202
+ declare function italic<Content extends string>(content: Content): `_${Content}_`;
203
203
  /**
204
204
  * Formats the content into bold text.
205
205
  *
206
- * @typeParam C - This is inferred by the supplied content
206
+ * @typeParam Content - This is inferred by the supplied content
207
207
  * @param content - The content to wrap
208
208
  */
209
- declare function bold<C extends string>(content: C): `**${C}**`;
209
+ declare function bold<Content extends string>(content: Content): `**${Content}**`;
210
210
  /**
211
211
  * Formats the content into underscored text.
212
212
  *
213
- * @typeParam C - This is inferred by the supplied content
213
+ * @typeParam Content - This is inferred by the supplied content
214
214
  * @param content - The content to wrap
215
+ * @deprecated Use {@link underline} instead.
215
216
  */
216
- declare function underscore<C extends string>(content: C): `__${C}__`;
217
+ declare function underscore<Content extends string>(content: Content): `__${Content}__`;
218
+ /**
219
+ * Formats the content into underlined text.
220
+ *
221
+ * @typeParam Content - This is inferred by the supplied content
222
+ * @param content - The content to wrap
223
+ */
224
+ declare function underline<Content extends string>(content: Content): `__${Content}__`;
217
225
  /**
218
226
  * Formats the content into strike-through text.
219
227
  *
220
- * @typeParam C - This is inferred by the supplied content
228
+ * @typeParam Content - This is inferred by the supplied content
221
229
  * @param content - The content to wrap
222
230
  */
223
- declare function strikethrough<C extends string>(content: C): `~~${C}~~`;
231
+ declare function strikethrough<Content extends string>(content: Content): `~~${Content}~~`;
224
232
  /**
225
233
  * Formats the content into a quote.
226
234
  *
227
235
  * @remarks This needs to be at the start of the line for Discord to format it.
228
- * @typeParam C - This is inferred by the supplied content
236
+ * @typeParam Content - This is inferred by the supplied content
229
237
  * @param content - The content to wrap
230
238
  */
231
- declare function quote<C extends string>(content: C): `> ${C}`;
239
+ declare function quote<Content extends string>(content: Content): `> ${Content}`;
232
240
  /**
233
241
  * Formats the content into a block quote.
234
242
  *
235
243
  * @remarks This needs to be at the start of the line for Discord to format it.
236
- * @typeParam C - This is inferred by the supplied content
244
+ * @typeParam Content - This is inferred by the supplied content
237
245
  * @param content - The content to wrap
238
246
  */
239
- declare function blockQuote<C extends string>(content: C): `>>> ${C}`;
247
+ declare function blockQuote<Content extends string>(content: Content): `>>> ${Content}`;
240
248
  /**
241
249
  * Wraps the URL into `<>` which stops it from embedding.
242
250
  *
243
- * @typeParam C - This is inferred by the supplied content
251
+ * @typeParam Content - This is inferred by the supplied content
244
252
  * @param url - The URL to wrap
245
253
  */
246
- declare function hideLinkEmbed<C extends string>(url: C): `<${C}>`;
254
+ declare function hideLinkEmbed<Content extends string>(url: Content): `<${Content}>`;
247
255
  /**
248
256
  * Wraps the URL into `<>` which stops it from embedding.
249
257
  *
@@ -253,161 +261,281 @@ declare function hideLinkEmbed(url: URL): `<${string}>`;
253
261
  /**
254
262
  * Formats the content and the URL into a masked URL.
255
263
  *
256
- * @typeParam C - This is inferred by the supplied content
264
+ * @typeParam Content - This is inferred by the supplied content
257
265
  * @param content - The content to display
258
266
  * @param url - The URL the content links to
259
267
  */
260
- declare function hyperlink<C extends string>(content: C, url: URL): `[${C}](${string})`;
268
+ declare function hyperlink<Content extends string>(content: Content, url: URL): `[${Content}](${string})`;
261
269
  /**
262
270
  * Formats the content and the URL into a masked URL.
263
271
  *
264
- * @typeParam C - This is inferred by the supplied content
265
- * @typeParam U - This is inferred by the supplied URL
272
+ * @typeParam Content - This is inferred by the supplied content
273
+ * @typeParam Url - This is inferred by the supplied URL
266
274
  * @param content - The content to display
267
275
  * @param url - The URL the content links to
268
276
  */
269
- declare function hyperlink<C extends string, U extends string>(content: C, url: U): `[${C}](${U})`;
277
+ declare function hyperlink<Content extends string, Url extends string>(content: Content, url: Url): `[${Content}](${Url})`;
270
278
  /**
271
279
  * Formats the content and the URL into a masked URL with a custom tooltip.
272
280
  *
273
- * @typeParam C - This is inferred by the supplied content
274
- * @typeParam T - This is inferred by the supplied title
281
+ * @typeParam Content - This is inferred by the supplied content
282
+ * @typeParam Title - This is inferred by the supplied title
275
283
  * @param content - The content to display
276
284
  * @param url - The URL the content links to
277
285
  * @param title - The title shown when hovering on the masked link
278
286
  */
279
- declare function hyperlink<C extends string, T extends string>(content: C, url: URL, title: T): `[${C}](${string} "${T}")`;
287
+ declare function hyperlink<Content extends string, Title extends string>(content: Content, url: URL, title: Title): `[${Content}](${string} "${Title}")`;
280
288
  /**
281
289
  * Formats the content and the URL into a masked URL with a custom tooltip.
282
290
  *
283
- * @typeParam C - This is inferred by the supplied content
284
- * @typeParam U - This is inferred by the supplied URL
285
- * @typeParam T - This is inferred by the supplied title
291
+ * @typeParam Content - This is inferred by the supplied content
292
+ * @typeParam Url - This is inferred by the supplied URL
293
+ * @typeParam Title - This is inferred by the supplied title
286
294
  * @param content - The content to display
287
295
  * @param url - The URL the content links to
288
296
  * @param title - The title shown when hovering on the masked link
289
297
  */
290
- declare function hyperlink<C extends string, U extends string, T extends string>(content: C, url: U, title: T): `[${C}](${U} "${T}")`;
298
+ declare function hyperlink<Content extends string, Url extends string, Title extends string>(content: Content, url: Url, title: Title): `[${Content}](${Url} "${Title}")`;
291
299
  /**
292
300
  * Formats the content into a spoiler.
293
301
  *
294
- * @typeParam C - This is inferred by the supplied content
302
+ * @typeParam Content - This is inferred by the supplied content
295
303
  * @param content - The content to wrap
296
304
  */
297
- declare function spoiler<C extends string>(content: C): `||${C}||`;
305
+ declare function spoiler<Content extends string>(content: Content): `||${Content}||`;
298
306
  /**
299
307
  * Formats a user id into a user mention.
300
308
  *
301
- * @typeParam C - This is inferred by the supplied user id
309
+ * @typeParam UserId - This is inferred by the supplied user id
302
310
  * @param userId - The user id to format
303
311
  */
304
- declare function userMention<C extends Snowflake>(userId: C): `<@${C}>`;
312
+ declare function userMention<UserId extends Snowflake>(userId: UserId): `<@${UserId}>`;
305
313
  /**
306
314
  * Formats a channel id into a channel mention.
307
315
  *
308
- * @typeParam C - This is inferred by the supplied channel id
316
+ * @typeParam ChannelId - This is inferred by the supplied channel id
309
317
  * @param channelId - The channel id to format
310
318
  */
311
- declare function channelMention<C extends Snowflake>(channelId: C): `<#${C}>`;
319
+ declare function channelMention<ChannelId extends Snowflake>(channelId: ChannelId): `<#${ChannelId}>`;
312
320
  /**
313
321
  * Formats a role id into a role mention.
314
322
  *
315
- * @typeParam C - This is inferred by the supplied role id
323
+ * @typeParam RoleId - This is inferred by the supplied role id
316
324
  * @param roleId - The role id to format
317
325
  */
318
- declare function roleMention<C extends Snowflake>(roleId: C): `<@&${C}>`;
326
+ declare function roleMention<RoleId extends Snowflake>(roleId: RoleId): `<@&${RoleId}>`;
327
+ /**
328
+ * Formats a role id into a linked role mention.
329
+ *
330
+ * @typeParam RoleId - This is inferred by the supplied role id
331
+ * @param roleId - The role id to format
332
+ */
333
+ declare function linkedRoleMention<RoleId extends Snowflake>(roleId: RoleId): `<id:linked-roles:${RoleId}>`;
319
334
  /**
320
335
  * Formats an application command name, subcommand group name, subcommand name, and id into an application command mention.
321
336
  *
322
- * @typeParam N - This is inferred by the supplied command name
323
- * @typeParam G - This is inferred by the supplied subcommand group name
324
- * @typeParam S - This is inferred by the supplied subcommand name
325
- * @typeParam I - This is inferred by the supplied command id
337
+ * @typeParam CommandName - This is inferred by the supplied command name
338
+ * @typeParam SubcommandGroupName - This is inferred by the supplied subcommand group name
339
+ * @typeParam SubcommandName - This is inferred by the supplied subcommand name
340
+ * @typeParam CommandId - This is inferred by the supplied command id
326
341
  * @param commandName - The application command name to format
327
342
  * @param subcommandGroupName - The subcommand group name to format
328
343
  * @param subcommandName - The subcommand name to format
329
344
  * @param commandId - The application command id to format
330
345
  */
331
- declare function chatInputApplicationCommandMention<N extends string, G extends string, S extends string, I extends Snowflake>(commandName: N, subcommandGroupName: G, subcommandName: S, commandId: I): `</${N} ${G} ${S}:${I}>`;
346
+ declare function chatInputApplicationCommandMention<CommandName extends string, SubcommandGroupName extends string, SubcommandName extends string, CommandId extends Snowflake>(commandName: CommandName, subcommandGroupName: SubcommandGroupName, subcommandName: SubcommandName, commandId: CommandId): `</${CommandName} ${SubcommandGroupName} ${SubcommandName}:${CommandId}>`;
332
347
  /**
333
348
  * Formats an application command name, subcommand name, and id into an application command mention.
334
349
  *
335
- * @typeParam N - This is inferred by the supplied command name
336
- * @typeParam S - This is inferred by the supplied subcommand name
337
- * @typeParam I - This is inferred by the supplied command id
350
+ * @typeParam CommandName - This is inferred by the supplied command name
351
+ * @typeParam SubcommandName - This is inferred by the supplied subcommand name
352
+ * @typeParam CommandId - This is inferred by the supplied command id
338
353
  * @param commandName - The application command name to format
339
354
  * @param subcommandName - The subcommand name to format
340
355
  * @param commandId - The application command id to format
341
356
  */
342
- declare function chatInputApplicationCommandMention<N extends string, S extends string, I extends Snowflake>(commandName: N, subcommandName: S, commandId: I): `</${N} ${S}:${I}>`;
357
+ declare function chatInputApplicationCommandMention<CommandName extends string, SubcommandName extends string, CommandId extends Snowflake>(commandName: CommandName, subcommandName: SubcommandName, commandId: CommandId): `</${CommandName} ${SubcommandName}:${CommandId}>`;
343
358
  /**
344
359
  * Formats an application command name and id into an application command mention.
345
360
  *
346
- * @typeParam N - This is inferred by the supplied command name
347
- * @typeParam I - This is inferred by the supplied command id
361
+ * @typeParam CommandName - This is inferred by the supplied command name
362
+ * @typeParam CommandId - This is inferred by the supplied command id
348
363
  * @param commandName - The application command name to format
349
364
  * @param commandId - The application command id to format
350
365
  */
351
- declare function chatInputApplicationCommandMention<N extends string, I extends Snowflake>(commandName: N, commandId: I): `</${N}:${I}>`;
366
+ declare function chatInputApplicationCommandMention<CommandName extends string, CommandId extends Snowflake>(commandName: CommandName, commandId: CommandId): `</${CommandName}:${CommandId}>`;
352
367
  /**
353
368
  * Formats a non-animated emoji id into a fully qualified emoji identifier.
354
369
  *
355
- * @typeParam C - This is inferred by the supplied emoji id
370
+ * @typeParam EmojiId - This is inferred by the supplied emoji id
356
371
  * @param emojiId - The emoji id to format
357
372
  */
358
- declare function formatEmoji<C extends Snowflake>(emojiId: C, animated?: false): `<:_:${C}>`;
373
+ declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: false): `<:emoji:${EmojiId}>`;
359
374
  /**
360
375
  * Formats an animated emoji id into a fully qualified emoji identifier.
361
376
  *
362
- * @typeParam C - This is inferred by the supplied emoji id
377
+ * @typeParam EmojiId - This is inferred by the supplied emoji id
363
378
  * @param emojiId - The emoji id to format
364
379
  * @param animated - Whether the emoji is animated
365
380
  */
366
- declare function formatEmoji<C extends Snowflake>(emojiId: C, animated?: true): `<a:_:${C}>`;
381
+ declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: true): `<a:emoji:${EmojiId}>`;
367
382
  /**
368
383
  * Formats an emoji id into a fully qualified emoji identifier.
369
384
  *
370
- * @typeParam C - This is inferred by the supplied emoji id
385
+ * @typeParam EmojiId - This is inferred by the supplied emoji id
371
386
  * @param emojiId - The emoji id to format
372
387
  * @param animated - Whether the emoji is animated
373
388
  */
374
- declare function formatEmoji<C extends Snowflake>(emojiId: C, animated?: boolean): `<:_:${C}>` | `<a:_:${C}>`;
389
+ declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: boolean): `<:emoji:${EmojiId}>` | `<a:emoji:${EmojiId}>`;
390
+ /**
391
+ * Formats a non-animated emoji id and name into a fully qualified emoji identifier.
392
+ *
393
+ * @typeParam EmojiId - This is inferred by the supplied emoji id
394
+ * @typeParam EmojiName - This is inferred by the supplied name
395
+ * @param options - The options for formatting an emoji
396
+ */
397
+ declare function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(options: FormatEmojiOptions<EmojiId, EmojiName> & {
398
+ animated: true;
399
+ }): `<a:${EmojiName}:${EmojiId}>`;
400
+ /**
401
+ * Formats an animated emoji id and name into a fully qualified emoji identifier.
402
+ *
403
+ * @typeParam EmojiId - This is inferred by the supplied emoji id
404
+ * @typeParam EmojiName - This is inferred by the supplied name
405
+ * @param options - The options for formatting an emoji
406
+ */
407
+ declare function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(options: FormatEmojiOptions<EmojiId, EmojiName> & {
408
+ animated?: false;
409
+ }): `<:${EmojiName}:${EmojiId}>`;
410
+ /**
411
+ * Formats an emoji id and name into a fully qualified emoji identifier.
412
+ *
413
+ * @typeParam EmojiId - This is inferred by the supplied emoji id
414
+ * @typeParam EmojiName - This is inferred by the supplied emoji name
415
+ * @param options - The options for formatting an emoji
416
+ */
417
+ declare function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(options: FormatEmojiOptions<EmojiId, EmojiName>): `<:${EmojiName}:${EmojiId}>` | `<a:${EmojiName}:${EmojiId}>`;
418
+ /**
419
+ * The options for formatting an emoji.
420
+ *
421
+ * @typeParam EmojiId - This is inferred by the supplied emoji id
422
+ * @typeParam EmojiName - This is inferred by the supplied emoji name
423
+ */
424
+ interface FormatEmojiOptions<EmojiId extends Snowflake, EmojiName extends string> {
425
+ /**
426
+ * Whether the emoji is animated
427
+ */
428
+ animated?: boolean;
429
+ /**
430
+ * The emoji id to format
431
+ */
432
+ id: EmojiId;
433
+ /**
434
+ * The name of the emoji
435
+ */
436
+ name?: EmojiName;
437
+ }
375
438
  /**
376
439
  * Formats a channel link for a direct message channel.
377
440
  *
378
- * @typeParam C - This is inferred by the supplied channel id
441
+ * @typeParam ChannelId - This is inferred by the supplied channel id
379
442
  * @param channelId - The channel's id
380
443
  */
381
- declare function channelLink<C extends Snowflake>(channelId: C): `https://discord.com/channels/@me/${C}`;
444
+ declare function channelLink<ChannelId extends Snowflake>(channelId: ChannelId): `https://discord.com/channels/@me/${ChannelId}`;
382
445
  /**
383
446
  * Formats a channel link for a guild channel.
384
447
  *
385
- * @typeParam C - This is inferred by the supplied channel id
386
- * @typeParam G - This is inferred by the supplied guild id
448
+ * @typeParam ChannelId - This is inferred by the supplied channel id
449
+ * @typeParam GuildId - This is inferred by the supplied guild id
387
450
  * @param channelId - The channel's id
388
451
  * @param guildId - The guild's id
389
452
  */
390
- declare function channelLink<C extends Snowflake, G extends Snowflake>(channelId: C, guildId: G): `https://discord.com/channels/${G}/${C}`;
453
+ declare function channelLink<ChannelId extends Snowflake, GuildId extends Snowflake>(channelId: ChannelId, guildId: GuildId): `https://discord.com/channels/${GuildId}/${ChannelId}`;
391
454
  /**
392
455
  * Formats a message link for a direct message channel.
393
456
  *
394
- * @typeParam C - This is inferred by the supplied channel id
395
- * @typeParam M - This is inferred by the supplied message id
457
+ * @typeParam ChannelId - This is inferred by the supplied channel id
458
+ * @typeParam MessageId - This is inferred by the supplied message id
396
459
  * @param channelId - The channel's id
397
460
  * @param messageId - The message's id
398
461
  */
399
- declare function messageLink<C extends Snowflake, M extends Snowflake>(channelId: C, messageId: M): `https://discord.com/channels/@me/${C}/${M}`;
462
+ declare function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake>(channelId: ChannelId, messageId: MessageId): `https://discord.com/channels/@me/${ChannelId}/${MessageId}`;
400
463
  /**
401
464
  * Formats a message link for a guild channel.
402
465
  *
403
- * @typeParam C - This is inferred by the supplied channel id
404
- * @typeParam M - This is inferred by the supplied message id
405
- * @typeParam G - This is inferred by the supplied guild id
466
+ * @typeParam ChannelId - This is inferred by the supplied channel id
467
+ * @typeParam MessageId - This is inferred by the supplied message id
468
+ * @typeParam GuildId - This is inferred by the supplied guild id
406
469
  * @param channelId - The channel's id
407
470
  * @param messageId - The message's id
408
471
  * @param guildId - The guild's id
409
472
  */
410
- declare function messageLink<C extends Snowflake, M extends Snowflake, G extends Snowflake>(channelId: C, messageId: M, guildId: G): `https://discord.com/channels/${G}/${C}/${M}`;
473
+ declare function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake, GuildId extends Snowflake>(channelId: ChannelId, messageId: MessageId, guildId: GuildId): `https://discord.com/channels/${GuildId}/${ChannelId}/${MessageId}`;
474
+ /**
475
+ * The heading levels for expanded markdown.
476
+ */
477
+ declare enum HeadingLevel {
478
+ /**
479
+ * The first heading level.
480
+ */
481
+ One = 1,
482
+ /**
483
+ * The second heading level.
484
+ */
485
+ Two = 2,
486
+ /**
487
+ * The third heading level.
488
+ */
489
+ Three = 3
490
+ }
491
+ /**
492
+ * Formats the content into a heading level.
493
+ *
494
+ * @typeParam Content - This is inferred by the supplied content
495
+ * @param content - The content to wrap
496
+ * @param level - The heading level
497
+ */
498
+ declare function heading<Content extends string>(content: Content, level?: HeadingLevel.One): `# ${Content}`;
499
+ /**
500
+ * Formats the content into a heading level.
501
+ *
502
+ * @typeParam Content - This is inferred by the supplied content
503
+ * @param content - The content to wrap
504
+ * @param level - The heading level
505
+ */
506
+ declare function heading<Content extends string>(content: Content, level: HeadingLevel.Two): `## ${Content}`;
507
+ /**
508
+ * Formats the content into a heading level.
509
+ *
510
+ * @typeParam Content - This is inferred by the supplied content
511
+ * @param content - The content to wrap
512
+ * @param level - The heading level
513
+ */
514
+ declare function heading<Content extends string>(content: Content, level: HeadingLevel.Three): `### ${Content}`;
515
+ /**
516
+ * A type that recursively traverses into arrays.
517
+ */
518
+ type RecursiveArray<ItemType> = readonly (ItemType | RecursiveArray<ItemType>)[];
519
+ /**
520
+ * Formats the elements in the array to an ordered list.
521
+ *
522
+ * @param list - The array of elements to list
523
+ * @param startNumber - The starting number for the list
524
+ */
525
+ declare function orderedList(list: RecursiveArray<string>, startNumber?: number): string;
526
+ /**
527
+ * Formats the elements in the array to an unordered list.
528
+ *
529
+ * @param list - The array of elements to list
530
+ */
531
+ declare function unorderedList(list: RecursiveArray<string>): string;
532
+ /**
533
+ * Formats the content into a subtext.
534
+ *
535
+ * @typeParam Content - This is inferred by the supplied content
536
+ * @param content - The content to wrap
537
+ */
538
+ declare function subtext<Content extends string>(content: Content): `-# ${Content}`;
411
539
  /**
412
540
  * Formats a date into a short date-time string.
413
541
  *
@@ -417,27 +545,43 @@ declare function time(date?: Date): `<t:${bigint}>`;
417
545
  /**
418
546
  * Formats a date given a format style.
419
547
  *
420
- * @typeParam S - This is inferred by the supplied {@link TimestampStylesString}
548
+ * @typeParam Style - This is inferred by the supplied {@link TimestampStylesString}
421
549
  * @param date - The date to format
422
550
  * @param style - The style to use
423
551
  */
424
- declare function time<S extends TimestampStylesString>(date: Date, style: S): `<t:${bigint}:${S}>`;
552
+ declare function time<Style extends TimestampStylesString>(date: Date, style: Style): `<t:${bigint}:${Style}>`;
425
553
  /**
426
554
  * Formats the given timestamp into a short date-time string.
427
555
  *
428
- * @typeParam C - This is inferred by the supplied timestamp
556
+ * @typeParam Seconds - This is inferred by the supplied timestamp
429
557
  * @param seconds - A Unix timestamp in seconds
430
558
  */
431
- declare function time<C extends number>(seconds: C): `<t:${C}>`;
559
+ declare function time<Seconds extends number>(seconds: Seconds): `<t:${Seconds}>`;
432
560
  /**
433
561
  * Formats the given timestamp into a short date-time string.
434
562
  *
435
- * @typeParam C - This is inferred by the supplied timestamp
436
- * @typeParam S - This is inferred by the supplied {@link TimestampStylesString}
563
+ * @typeParam Seconds - This is inferred by the supplied timestamp
564
+ * @typeParam Style - This is inferred by the supplied {@link TimestampStylesString}
437
565
  * @param seconds - A Unix timestamp in seconds
438
566
  * @param style - The style to use
439
567
  */
440
- declare function time<C extends number, S extends TimestampStylesString>(seconds: C, style: S): `<t:${C}:${S}>`;
568
+ declare function time<Seconds extends number, Style extends TimestampStylesString>(seconds: Seconds, style: Style): `<t:${Seconds}:${Style}>`;
569
+ /**
570
+ * Formats an application directory link.
571
+ *
572
+ * @typeParam ApplicationId - This is inferred by the supplied application id
573
+ * @param applicationId - The application id
574
+ */
575
+ declare function applicationDirectory<ApplicationId extends Snowflake>(applicationId: ApplicationId): `https://discord.com/application-directory/${ApplicationId}/store`;
576
+ /**
577
+ * Formats an application directory SKU link.
578
+ *
579
+ * @typeParam ApplicationId - This is inferred by the supplied application id
580
+ * @typeParam SKUId - This is inferred by the supplied SKU id
581
+ * @param applicationId - The application id
582
+ * @param skuId - The SKU id
583
+ */
584
+ declare function applicationDirectory<ApplicationId extends Snowflake, SKUId extends Snowflake>(applicationId: ApplicationId, skuId: SKUId): `https://discord.com/application-directory/${ApplicationId}/store/${SKUId}`;
441
585
  /**
442
586
  * The {@link https://discord.com/developers/docs/reference#message-formatting-timestamp-styles | message formatting timestamp styles}
443
587
  * supported by Discord.
@@ -497,7 +641,7 @@ declare enum Faces {
497
641
  /**
498
642
  * `¯\_(ツ)_/¯`
499
643
  */
500
- Shrug = "\u00AF_(\u30C4)_/\u00AF",
644
+ Shrug = "\u00AF\\_(\u30C4)_/\u00AF",
501
645
  /**
502
646
  * `(╯°□°)╯︵ ┻━┻`
503
647
  */
@@ -507,5 +651,34 @@ declare enum Faces {
507
651
  */
508
652
  Unflip = "\u252C\u2500\u252C\u30CE( \u00BA _ \u00BA\u30CE)"
509
653
  }
654
+ /**
655
+ * All the available guild navigation mentions.
656
+ */
657
+ declare enum GuildNavigationMentions {
658
+ /**
659
+ * Browse Channels tab.
660
+ */
661
+ Browse = "<id:browse>",
662
+ /**
663
+ * Customize tab with the server's {@link https://discord.com/developers/docs/resources/guild#guild-onboarding-object | onboarding prompts}.
664
+ */
665
+ Customize = "<id:customize>",
666
+ /**
667
+ * {@link https://support.discord.com/hc/articles/13497665141655 | Server Guide} tab.
668
+ */
669
+ Guide = "<id:guide>",
670
+ /**
671
+ * {@link https://support.discord.com/hc/articles/10388356626711 | Linked Roles} tab.
672
+ */
673
+ LinkedRoles = "<id:linked-roles>"
674
+ }
675
+
676
+ /**
677
+ * The {@link https://github.com/discordjs/discord.js/blob/main/packages/formatters#readme | @discordjs/formatters} version
678
+ * that you are currently using.
679
+ *
680
+ * @privateRemarks This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild.
681
+ */
682
+ declare const version: string;
510
683
 
511
- export { EscapeMarkdownOptions, Faces, TimestampStyles, TimestampStylesString, blockQuote, bold, channelLink, channelMention, chatInputApplicationCommandMention, codeBlock, escapeBold, escapeBulletedList, escapeCodeBlock, escapeEscape, escapeHeading, escapeInlineCode, escapeItalic, escapeMarkdown, escapeMaskedLink, escapeNumberedList, escapeSpoiler, escapeStrikethrough, escapeUnderline, formatEmoji, hideLinkEmbed, hyperlink, inlineCode, italic, messageLink, quote, roleMention, spoiler, strikethrough, time, underscore, userMention };
684
+ export { type EscapeMarkdownOptions, Faces, type FormatEmojiOptions, GuildNavigationMentions, HeadingLevel, type RecursiveArray, TimestampStyles, type TimestampStylesString, applicationDirectory, blockQuote, bold, channelLink, channelMention, chatInputApplicationCommandMention, codeBlock, escapeBold, escapeBulletedList, escapeCodeBlock, escapeEscape, escapeHeading, escapeInlineCode, escapeItalic, escapeMarkdown, escapeMaskedLink, escapeNumberedList, escapeSpoiler, escapeStrikethrough, escapeUnderline, formatEmoji, heading, hideLinkEmbed, hyperlink, inlineCode, italic, linkedRoleMention, messageLink, orderedList, quote, roleMention, spoiler, strikethrough, subtext, time, underline, underscore, unorderedList, userMention, version };