discord-message-transcript-base 1.3.2-dev.0.49 → 1.3.2-dev.1.50

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.
Files changed (37) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/core/markdown.d.ts +1 -1
  3. package/dist/core/output.d.ts +2 -1
  4. package/dist/core/output.js +1 -1
  5. package/dist/core/sanitizer.d.ts +1 -1
  6. package/dist/index.d.ts +5 -6
  7. package/dist/index.js +6 -8
  8. package/dist/internalIndex.d.ts +4 -0
  9. package/dist/internalIndex.js +4 -0
  10. package/dist/renderers/html/html.d.ts +1 -1
  11. package/dist/renderers/html/html.js +9 -9
  12. package/dist/types/internal/index.d.ts +7 -0
  13. package/dist/types/internal/index.js +7 -0
  14. package/dist/types/internal/message/components.d.ts +252 -0
  15. package/dist/types/internal/message/components.js +1 -0
  16. package/dist/types/internal/message/componentsV2.d.ts +138 -0
  17. package/dist/types/internal/message/componentsV2.js +1 -0
  18. package/dist/types/internal/message/enum.d.ts +41 -0
  19. package/dist/types/{types.js → internal/message/enum.js} +6 -52
  20. package/dist/types/internal/message/messageItens.d.ts +149 -0
  21. package/dist/types/internal/message/messageItens.js +1 -0
  22. package/dist/types/internal/parse.d.ts +53 -0
  23. package/dist/types/internal/parse.js +7 -0
  24. package/dist/types/internal/return.d.ts +17 -0
  25. package/dist/types/internal/return.js +13 -0
  26. package/dist/types/internal/transcript.d.ts +91 -0
  27. package/dist/types/internal/transcript.js +1 -0
  28. package/dist/types/internal/util.d.ts +51 -0
  29. package/dist/types/internal/util.js +1 -0
  30. package/dist/types/public/index.d.ts +2 -0
  31. package/dist/types/public/index.js +2 -0
  32. package/dist/types/public/return.d.ts +25 -0
  33. package/dist/types/public/return.js +21 -0
  34. package/dist/types/public/transcript.d.ts +25 -0
  35. package/dist/types/public/transcript.js +1 -0
  36. package/package.json +6 -2
  37. package/dist/types/types.d.ts +0 -824
@@ -1,824 +0,0 @@
1
- import Stream from "stream";
2
- /**
3
- * A union of all component types that can be placed inside a `JsonContainerComponent`.
4
- */
5
- export type JsonComponentInContainer = JsonActionRow | JsonFileComponent | JsonMediaGalleryComponent | JsonSectionComponent | JsonSeparatorComponent | JsonTextDisplayComponent;
6
- /**
7
- * A union of all possible select menu types.
8
- */
9
- export type JsonSelectMenu = JsonSelectMenuOthers | JsonSelectMenuString;
10
- /**
11
- * A union of all top-level component types that can exist directly in a message.
12
- */
13
- export type JsonTopLevelComponent = JsonActionRow | JsonButtonComponent | JsonSelectMenu | JsonV2Component;
14
- /**
15
- * A union of all V2 component types.
16
- */
17
- export type JsonV2Component = JsonContainerComponent | JsonFileComponent | JsonMediaGalleryComponent | JsonSectionComponent | JsonSeparatorComponent | JsonTextDisplayComponent | JsonThumbnailComponent;
18
- /**
19
- * A hexColor type
20
- */
21
- export type hexColor = `#${string}`;
22
- /**
23
- * A union of all possible timestamp styles for formatting dates and times in Discord.
24
- */
25
- export type StyleTimeStampKey = "t" | "T" | "d" | "D" | "f" | "F";
26
- /**
27
- * Represents a BCP 47 language tag for date/time formatting.
28
- */
29
- export type LocalDate = 'ar-EG' | 'ar-SA' | 'bn-BD' | 'bn-IN' | 'cs-CZ' | 'da-DK' | 'de-AT' | 'de-CH' | 'de-DE' | 'el-GR' | 'en-AU' | 'en-CA' | 'en-GB' | 'en-IN' | 'en-US' | 'es-AR' | 'es-CO' | 'es-ES' | 'es-MX' | 'fa-IR' | 'fi-FI' | 'fr-BE' | 'fr-CA' | 'fr-FR' | 'he-IL' | 'hi-IN' | 'hu-HU' | 'id-ID' | 'it-IT' | 'ja-JP' | 'ko-KR' | 'ms-MY' | 'nl-BE' | 'nl-NL' | 'no-NO' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ro-RO' | 'ru-RU' | 'sv-SE' | 'th-TH' | 'tr-TR' | 'uk-UA' | 'ur-PK' | 'vi-VN' | 'zh-CN' | 'zh-HK' | 'zh-TW' | (string & {});
30
- /**
31
- * Represents an IANA time zone name for date/time formatting.
32
- */
33
- export type TimeZone = 'Africa/Cairo' | 'Africa/Johannesburg' | 'Africa/Lagos' | 'America/Argentina/Buenos_Aires' | 'America/Bogota' | 'America/Los_Angeles' | 'America/Mexico_City' | 'America/New_York' | 'America/Sao_Paulo' | 'America/Toronto' | 'America/Vancouver' | 'Asia/Bangkok' | 'Asia/Dhaka' | 'Asia/Dubai' | 'Asia/Ho_Chi_Minh' | 'Asia/Hong_Kong' | 'Asia/Istanbul' | 'Asia/Jakarta' | 'Asia/Jerusalem' | 'Asia/Karachi' | 'Asia/Kolkata' | 'Asia/Kuala_Lumpur' | 'Asia/Manila' | 'Asia/Riyadh' | 'Asia/Seoul' | 'Asia/Shanghai' | 'Asia/Taipei' | 'Asia/Tehran' | 'Asia/Tokyo' | 'Australia/Melbourne' | 'Australia/Perth' | 'Australia/Sydney' | 'Europe/Amsterdam' | 'Europe/Athens' | 'Europe/Berlin' | 'Europe/Brussels' | 'Europe/Budapest' | 'Europe/Copenhagen' | 'Europe/Helsinki' | 'Europe/Kyiv' | 'Europe/Lisbon' | 'Europe/London' | 'Europe/Madrid' | 'Europe/Moscow' | 'Europe/Oslo' | 'Europe/Paris' | 'Europe/Prague' | 'Europe/Rome' | 'Europe/Stockholm' | 'Europe/Warsaw' | 'Pacific/Auckland' | 'UTC' | (string & {});
34
- /**
35
- * A conditional type that maps a `ReturnTypeBase` literal to the actual TypeScript type.
36
- */
37
- export type OutputTypeBase<T extends ReturnTypeBase> = T extends typeof ReturnTypeBase.Buffer ? Buffer : T extends typeof ReturnTypeBase.Stream ? Stream : T extends typeof ReturnTypeBase.Uploadable ? Uploadable : string;
38
- /**
39
- * An enum-like object for the possible return types, excluding 'attachment'.
40
- */
41
- export declare const ReturnTypeBase: {
42
- /**
43
- * Returns a `Buffer`.
44
- */
45
- readonly Buffer: "buffer";
46
- /**
47
- * Returns a `Stream.Readable`.
48
- */
49
- readonly Stream: "stream";
50
- /**
51
- * Returns a `string`.
52
- */
53
- readonly String: "string";
54
- /**
55
- * Returns an `Uploadable` object.
56
- */
57
- readonly Uploadable: "uploadable";
58
- };
59
- /**
60
- * A type representing the possible values of `ReturnTypeBase`.
61
- */
62
- export type ReturnTypeBase = typeof ReturnTypeBase[keyof typeof ReturnTypeBase];
63
- /**
64
- * An enum for all possible return types, used for parsing.
65
- */
66
- export declare enum ReturnTypeParse {
67
- Attachment = "attachment",
68
- Buffer = "buffer",
69
- Stream = "stream",
70
- String = "string",
71
- Uploadable = "uploadable"
72
- }
73
- /**
74
- * An enum-like object for the possible transcript formats.
75
- */
76
- export declare const ReturnFormat: {
77
- /**
78
- * JSON format.
79
- */
80
- readonly JSON: "JSON";
81
- /**
82
- * HTML format.
83
- */
84
- readonly HTML: "HTML";
85
- };
86
- /**
87
- * A type representing the possible values of `ReturnFormat`.
88
- */
89
- export type ReturnFormat = typeof ReturnFormat[keyof typeof ReturnFormat];
90
- /**
91
- * Base options for creating a transcript.
92
- */
93
- export interface TranscriptOptionsBase {
94
- /**
95
- * The name of the generated file.
96
- */
97
- fileName: string;
98
- /**
99
- * Disable all warnings to keep console output clean.
100
- * ⚠️ Can hide issues like unsafe URLs or fallback usage.
101
- * @default false
102
- */
103
- disableWarnings: boolean;
104
- /**
105
- * Whether to include attachments.
106
- */
107
- includeAttachments: boolean;
108
- /**
109
- * Whether to include buttons.
110
- */
111
- includeButtons: boolean;
112
- /**
113
- * Whether to include other components (like select menus).
114
- */
115
- includeComponents: boolean;
116
- /**
117
- * Whether to include empty messages.
118
- */
119
- includeEmpty: boolean;
120
- /**
121
- * Whether to include embeds.
122
- */
123
- includeEmbeds: boolean;
124
- /**
125
- * Whether to include polls.
126
- */
127
- includePolls: boolean;
128
- /**
129
- * Whether to include reactions.
130
- */
131
- includeReactions: boolean;
132
- /**
133
- * Whether to include V2 components.
134
- */
135
- includeV2Components: boolean;
136
- /**
137
- * The locale for date formatting.
138
- */
139
- localDate: LocalDate;
140
- /**
141
- * The number of messages to include.
142
- */
143
- quantity: number;
144
- /**
145
- * The format of the transcript (HTML or JSON).
146
- */
147
- returnFormat: ReturnFormat;
148
- /**
149
- * The type of the returned value (buffer, string, etc.).
150
- */
151
- returnType: ReturnTypeBase;
152
- /**
153
- * Enables safe mode, blocking potentially unsafe URLs and content.
154
- * Prevents suspicious links, images, or HTML from being included in the final transcript.
155
- *
156
- * ⚠️ Disabling may allow unsafe content to appear in the transcript.
157
- * @default true
158
- */
159
- safeMode: boolean;
160
- /**
161
- * Whether to save images as base64.
162
- * Only saves images with less than 25mb for safety - 25mb is a good security size to an image
163
- */
164
- saveImages: boolean;
165
- /**
166
- * Whether to generate a self-contained HTML file.
167
- */
168
- selfContained: boolean;
169
- /**
170
- * The timezone for date formatting.
171
- */
172
- timeZone: TimeZone;
173
- /**
174
- * Whether to include the watermark.
175
- */
176
- watermark: boolean;
177
- }
178
- /**
179
- * Transcript options used for parsing, with a different `returnType`.
180
- */
181
- export interface TranscriptOptionsParse {
182
- fileName: string;
183
- disableWarnings: boolean;
184
- includeAttachments: boolean;
185
- includeButtons: boolean;
186
- includeComponents: boolean;
187
- includeEmpty: boolean;
188
- includeEmbeds: boolean;
189
- includePolls: boolean;
190
- includeReactions: boolean;
191
- includeV2Components: boolean;
192
- localDate: LocalDate;
193
- quantity: number;
194
- returnFormat: ReturnFormat;
195
- returnType: ReturnTypeParse;
196
- safeMode: boolean;
197
- saveImages: boolean;
198
- selfContained: boolean;
199
- timeZone: TimeZone;
200
- watermark: boolean;
201
- }
202
- /**
203
- * Options for converting a JSON transcript to HTML.
204
- */
205
- export type ConvertTranscriptOptions<T extends ReturnTypeBase> = Partial<{
206
- /**
207
- * The desired output type for the transcript.
208
- * - ReturnType.String - The transcript content as a string.
209
- * - ReturnType.Buffer - The transcript content as a `Buffer`.
210
- * - ReturnType.Stream - The transcript content as a `Stream`.
211
- * - ReturnType.Uploadable` - An object with `content`, `contentType` and `fileName`.
212
- * @default ReturnType.String
213
- */
214
- returnType: T;
215
- /**
216
- * Whether the generated HTML should be self-contained (CSS and JS in HTML).
217
- * @default false
218
- */
219
- selfContained: boolean;
220
- /**
221
- * If you want to include the watermark.
222
- * @default true
223
- */
224
- watermark: boolean;
225
- }>;
226
- /**
227
- * Structure containing arrays of all mentions found in the transcript.
228
- */
229
- export interface ArrayMentions {
230
- /**
231
- * An array of mentioned channels.
232
- */
233
- channels: JsonMessageMentionsChannels[];
234
- /**
235
- * An array of mentioned roles.
236
- */
237
- roles: JsonMessageMentionsRoles[];
238
- /**
239
- * An array of mentioned users.
240
- */
241
- users: JsonMessageMentionsUsers[];
242
- }
243
- /**
244
- * A JSON-serializable representation of a Discord Action Row component.
245
- */
246
- export interface JsonActionRow {
247
- /**
248
- * The components within the action row (e.g., buttons, select menus).
249
- */
250
- components: (JsonButtonComponent | JsonSelectMenu)[];
251
- /**
252
- * The type of the component.
253
- */
254
- type: JsonComponentType.ActionRow;
255
- }
256
- /**
257
- * A JSON-serializable representation of a message attachment.
258
- */
259
- export interface JsonAttachment {
260
- /**
261
- * The MIME type of the attachment.
262
- */
263
- contentType: string | null;
264
- /**
265
- * The name of the attachment file.
266
- */
267
- name: string;
268
- /**
269
- * The size of the attachment in bytes.
270
- */
271
- size: number;
272
- /**
273
- * Whether the attachment is a spoiler.
274
- */
275
- spoiler: boolean;
276
- /**
277
- * The URL of the attachment.
278
- */
279
- url: string;
280
- }
281
- /**
282
- * A JSON-serializable representation of a message author.
283
- */
284
- export interface JsonAuthor {
285
- /**
286
- * The URL of the author's avatar.
287
- */
288
- avatarURL: string;
289
- /**
290
- * Whether the author is a bot.
291
- */
292
- bot: boolean;
293
- /**
294
- * The display name of the author.
295
- */
296
- displayName: string;
297
- /**
298
- * The guild-specific tag of the author, if any.
299
- */
300
- guildTag: string | null;
301
- /**
302
- * The ID of the author.
303
- */
304
- id: string;
305
- /**
306
- * Information about the author as a guild member.
307
- */
308
- member: {
309
- /**
310
- * The member's display color in hex format.
311
- */
312
- displayHexColor: hexColor;
313
- /**
314
- * The member's display name in the guild.
315
- */
316
- displayName: string;
317
- } | null;
318
- /**
319
- * Whether the author is a system user.
320
- */
321
- system: boolean;
322
- }
323
- /**
324
- * A JSON-serializable representation of a button component.
325
- */
326
- export interface JsonButtonComponent {
327
- /**
328
- * Whether the button is disabled.
329
- */
330
- disabled: boolean;
331
- /**
332
- * The emoji on the button, if any.
333
- */
334
- emoji: string | null;
335
- /**
336
- * The label text on the button.
337
- */
338
- label: string | null;
339
- /**
340
- * The style of the button.
341
- */
342
- style: JsonButtonStyle;
343
- /**
344
- * The type of the component.
345
- */
346
- type: JsonComponentType.Button;
347
- /**
348
- * The URL for link-style buttons.
349
- */
350
- url: string | null;
351
- }
352
- /**
353
- * A JSON-serializable representation of a V2 container component.
354
- */
355
- export interface JsonContainerComponent {
356
- /**
357
- * The components inside the container.
358
- */
359
- components: JsonComponentInContainer[];
360
- /**
361
- * The accent color of the container's border.
362
- */
363
- hexAccentColor: hexColor;
364
- /**
365
- * Whether the container's content is a spoiler.
366
- */
367
- spoiler: boolean;
368
- /**
369
- * The type of the component.
370
- */
371
- type: JsonComponentType.Container;
372
- }
373
- /**
374
- * The root object for a JSON transcript, containing all data.
375
- */
376
- export interface JsonData {
377
- /**
378
- * A list of all unique authors in the transcript.
379
- */
380
- authors: JsonAuthor[];
381
- /**
382
- * Information about the channel where the transcript was created.
383
- */
384
- channel: JsonDataChannel;
385
- /**
386
- * Information about the guild.
387
- */
388
- guild: JsonDataGuild | null;
389
- /**
390
- * An array of all messages in the transcript.
391
- */
392
- messages: JsonMessage[];
393
- /**
394
- * The options used to create this transcript.
395
- */
396
- options: TranscriptOptionsBase;
397
- /**
398
- * A list of all mentions found in the messages.
399
- */
400
- mentions: ArrayMentions;
401
- }
402
- /**
403
- * The root object for a JSON transcript, used for parsing.
404
- */
405
- export interface JsonDataParse {
406
- authors: JsonAuthor[];
407
- channel: JsonDataChannel;
408
- guild: JsonDataGuild | null;
409
- messages: JsonMessage[];
410
- options: TranscriptOptionsParse;
411
- mentions: ArrayMentions;
412
- }
413
- /**
414
- * A JSON-serializable representation of the transcript's channel.
415
- */
416
- export interface JsonDataChannel {
417
- /**
418
- * The ID of the channel.
419
- */
420
- id: string;
421
- /**
422
- * The icon URL for the channel (e.g., for DMs).
423
- */
424
- img: string | null;
425
- /**
426
- * The name of the channel.
427
- */
428
- name: string;
429
- /**
430
- * The parent category of the channel, if any.
431
- */
432
- parent: {
433
- name: string;
434
- id: string;
435
- } | null;
436
- /**
437
- * The topic of the channel.
438
- */
439
- topic: string | null;
440
- }
441
- /**
442
- * A JSON-serializable representation of the transcript's guild.
443
- */
444
- export interface JsonDataGuild {
445
- /**
446
- * The URL of the guild's icon.
447
- */
448
- icon: string | null;
449
- /**
450
- * The ID of the guild.
451
- */
452
- id: string;
453
- /**
454
- * The name of the guild.
455
- */
456
- name: string;
457
- }
458
- /**
459
- * A JSON-serializable representation of a message embed.
460
- */
461
- export interface JsonEmbed {
462
- author: {
463
- name: string;
464
- url: string | null;
465
- iconURL: string | null;
466
- } | null;
467
- description: string | null;
468
- fields: {
469
- inline: boolean | null;
470
- name: string;
471
- value: string;
472
- }[];
473
- footer: {
474
- iconURL: string | null;
475
- text: string;
476
- } | null;
477
- hexColor: hexColor | null;
478
- image: {
479
- url: string;
480
- } | null;
481
- thumbnail: {
482
- url: string;
483
- } | null;
484
- timestamp: string | null;
485
- title: string | null;
486
- type: string;
487
- url: string | null;
488
- }
489
- /**
490
- * A JSON-serializable representation of a V2 file component.
491
- */
492
- export interface JsonFileComponent {
493
- /**
494
- * The name of the file.
495
- */
496
- fileName: string | null;
497
- /**
498
- * The size of the file in bytes.
499
- */
500
- size: number;
501
- /**
502
- * Whether the file is a spoiler.
503
- */
504
- spoiler: boolean;
505
- /**
506
- * The type of the component.
507
- */
508
- type: JsonComponentType.File;
509
- /**
510
- * The URL of the file.
511
- */
512
- url: string;
513
- }
514
- /**
515
- * A JSON-serializable representation of a V2 media gallery component.
516
- */
517
- export interface JsonMediaGalleryComponent {
518
- /**
519
- * The items within the media gallery.
520
- */
521
- items: {
522
- media: {
523
- url: string;
524
- };
525
- spoiler: boolean;
526
- }[];
527
- /**
528
- * The type of the component.
529
- */
530
- type: JsonComponentType.MediaGallery;
531
- }
532
- /**
533
- * A JSON-serializable representation of a Discord message.
534
- */
535
- export interface JsonMessage {
536
- attachments: JsonAttachment[];
537
- authorId: string;
538
- components: JsonTopLevelComponent[];
539
- content: string;
540
- createdTimestamp: number;
541
- embeds: JsonEmbed[];
542
- id: string;
543
- mentions: boolean;
544
- poll: JsonPoll | null;
545
- reactions: JsonReaction[];
546
- references: {
547
- messageId: string | null;
548
- } | null;
549
- system: boolean;
550
- }
551
- /**
552
- * Structure containing arrays of mentions found in a message.
553
- */
554
- export interface JsonMessageMentions {
555
- channels: JsonMessageMentionsChannels[];
556
- roles: JsonMessageMentionsRoles[];
557
- users: JsonMessageMentionsUsers[];
558
- }
559
- /**
560
- * A JSON-serializable representation of a channel mention.
561
- */
562
- export interface JsonMessageMentionsChannels {
563
- id: string;
564
- name: string | null;
565
- }
566
- /**
567
- * A JSON-serializable representation of a role mention.
568
- */
569
- export interface JsonMessageMentionsRoles {
570
- id: string;
571
- name: string;
572
- color: hexColor;
573
- }
574
- /**
575
- * A JSON-serializable representation of a user mention.
576
- */
577
- export interface JsonMessageMentionsUsers {
578
- id: string;
579
- name: string;
580
- color: hexColor | null;
581
- }
582
- /**
583
- * A JSON-serializable representation of a poll.
584
- */
585
- export interface JsonPoll {
586
- /**
587
- * The answers available in the poll.
588
- */
589
- answers: JsonPollAnswer[];
590
- /**
591
- * A formatted string indicating when the poll expires.
592
- */
593
- expiry: string | null;
594
- /**
595
- * Whether the poll has been finalized.
596
- */
597
- isFinalized: boolean;
598
- /**
599
- * The question of the poll.
600
- */
601
- question: string;
602
- }
603
- /**
604
- * A JSON-serializable representation of a single answer in a poll.
605
- */
606
- export interface JsonPollAnswer {
607
- /**
608
- * The number of votes for this answer.
609
- */
610
- count: number;
611
- /**
612
- * The emoji associated with this answer, if any.
613
- */
614
- emoji: {
615
- id: string | null;
616
- name: string | null;
617
- animated: boolean;
618
- } | null;
619
- /**
620
- * The ID of the answer.
621
- */
622
- id: number;
623
- /**
624
- * The text of the answer.
625
- */
626
- text: string;
627
- }
628
- /**
629
- * A JSON-serializable representation of a message reaction.
630
- */
631
- export interface JsonReaction {
632
- /**
633
- * The number of times the emoji was reacted.
634
- */
635
- count: number;
636
- /**
637
- * The emoji that was reacted.
638
- */
639
- emoji: string;
640
- }
641
- /**
642
- * A JSON-serializable representation of a V2 section component.
643
- */
644
- export interface JsonSectionComponent {
645
- /**
646
- * The accessory component on the right side of the section.
647
- */
648
- accessory: JsonButtonComponent | JsonThumbnailComponent | null;
649
- /**
650
- * The components inside the section.
651
- */
652
- components: JsonTextDisplayComponent[];
653
- /**
654
- * The type of the component.
655
- */
656
- type: JsonComponentType.Section;
657
- }
658
- /**
659
- * A JSON-serializable representation of an option in a select menu.
660
- */
661
- export interface JsonSelectOption {
662
- /**
663
- * The description of the option.
664
- */
665
- description: string | null;
666
- /**
667
- * The emoji for the option, if any.
668
- */
669
- emoji: {
670
- id: string | null;
671
- name: string | null;
672
- animated: boolean;
673
- } | null;
674
- /**
675
- * The user-facing label for the option.
676
- */
677
- label: string;
678
- }
679
- /**
680
- * A JSON-serializable representation of a V2 separator component.
681
- */
682
- export interface JsonSeparatorComponent {
683
- /**
684
- * Whether the separator is a visible line.
685
- */
686
- divider: boolean;
687
- /**
688
- * The spacing size of the separator.
689
- */
690
- spacing: JsonSeparatorSpacingSize;
691
- /**
692
- * The type of the component.
693
- */
694
- type: JsonComponentType.Separator;
695
- }
696
- /**
697
- * A JSON-serializable representation of a V2 text display component.
698
- */
699
- export interface JsonTextDisplayComponent {
700
- /**
701
- * The content of the text display.
702
- */
703
- content: string;
704
- /**
705
- * The type of the component.
706
- */
707
- type: JsonComponentType.TextDisplay;
708
- }
709
- /**
710
- * A JSON-serializable representation of a V2 thumbnail component.
711
- */
712
- export interface JsonThumbnailComponent {
713
- /**
714
- * The media information for the thumbnail.
715
- */
716
- media: {
717
- url: string;
718
- };
719
- /**
720
- * Whether the thumbnail is a spoiler.
721
- */
722
- spoiler: boolean;
723
- /**
724
- * The type of the component.
725
- */
726
- type: JsonComponentType.Thumbnail;
727
- }
728
- /**
729
- * Represents an object that can be uploaded.
730
- */
731
- export interface Uploadable {
732
- /**
733
- * The content to be uploaded.
734
- */
735
- content: string;
736
- /**
737
- * The MIME type of the content.
738
- */
739
- contentType: "application/json" | "text/html";
740
- /**
741
- * The name of the file.
742
- */
743
- fileName: string;
744
- }
745
- /**
746
- * An enum representing the styles of a Discord button.
747
- */
748
- export declare enum JsonButtonStyle {
749
- Primary = 1,
750
- Secondary = 2,
751
- Success = 3,
752
- Danger = 4,
753
- Link = 5,
754
- Premium = 6
755
- }
756
- /**
757
- * An enum representing all known component types.
758
- */
759
- export declare enum JsonComponentType {
760
- ActionRow = 1,
761
- Button = 2,
762
- StringSelect = 3,
763
- TextInput = 4,
764
- UserSelect = 5,
765
- RoleSelect = 6,
766
- MentionableSelect = 7,
767
- ChannelSelect = 8,
768
- Section = 9,
769
- TextDisplay = 10,
770
- Thumbnail = 11,
771
- MediaGallery = 12,
772
- File = 13,
773
- Separator = 14,
774
- ContentInventoryEntry = 16,
775
- Container = 17,
776
- Label = 18,
777
- FileUpload = 19
778
- }
779
- /**
780
- * An enum representing the spacing size of a separator component.
781
- */
782
- export declare enum JsonSeparatorSpacingSize {
783
- Small = 1,
784
- Large = 2
785
- }
786
- /**
787
- * A JSON-serializable representation of a non-string select menu.
788
- */
789
- interface JsonSelectMenuOthers {
790
- /**
791
- * Whether the select menu is disabled.
792
- */
793
- disabled: boolean;
794
- /**
795
- * The placeholder text for the select menu.
796
- */
797
- placeholder: string | null;
798
- /**
799
- * The type of the select menu.
800
- */
801
- type: JsonComponentType.UserSelect | JsonComponentType.RoleSelect | JsonComponentType.MentionableSelect | JsonComponentType.ChannelSelect;
802
- }
803
- /**
804
- * A JSON-serializable representation of a string select menu.
805
- */
806
- interface JsonSelectMenuString {
807
- /**
808
- * Whether the select menu is disabled.
809
- */
810
- disabled: boolean;
811
- /**
812
- * The options available in the select menu.
813
- */
814
- options: JsonSelectOption[];
815
- /**
816
- * The placeholder text for the select menu.
817
- */
818
- placeholder: string | null;
819
- /**
820
- * The type of the select menu.
821
- */
822
- type: JsonComponentType.StringSelect;
823
- }
824
- export {};