@discordjs/structures 0.2.0-dev.1752365789-3cff4d741

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.
@@ -0,0 +1,1399 @@
1
+ import { ChannelFlags, PermissionFlagsBits, GuildChannelType, ChannelType, ThreadChannelType, GuildTextChannelType, TextChannelType, APIChannel, APIPartialChannel, APIGuildForumTag, APIOverwrite, APIThreadMetadata, APINewsChannel, APIAnnouncementThreadChannel, APIGuildCategoryChannel, APIDMChannel, APIGuildForumChannel, APIGroupDMChannel, APIGuildMediaChannel, APIPrivateThreadChannel, APIPublicThreadChannel, APIGuildStageVoiceChannel, APITextChannel, APIGuildVoiceChannel, APIInvite, APIExtendedInvite, APIAvatarDecorationData, APIUser, APIConnection } from 'discord-api-types/v10';
2
+
3
+ type ReplaceOmittedWithUnknown<Omitted extends keyof Data | '', Data> = {
4
+ [Key in keyof Data]: Key extends Omitted ? unknown : Data[Key];
5
+ };
6
+ type CollapseUnion<Type> = Type extends infer Union ? {
7
+ [Key in keyof Union]: Union[Key];
8
+ } : never;
9
+ type OptionalPropertyNames<Type> = {
10
+ [Key in keyof Type]-?: {} extends {
11
+ [Prop in Key]: Type[Key];
12
+ } ? Key : never;
13
+ }[keyof Type];
14
+ type MergePrototype<Class1, Class2> = Pick<Class1, Exclude<keyof Class1, keyof Class2>> & Pick<Class2, Exclude<keyof Class2, OptionalPropertyNames<Class2>>> & Pick<Class2, Exclude<OptionalPropertyNames<Class2>, keyof Class1>> & {
15
+ [Prop in OptionalPropertyNames<Class2> & keyof Class1]: Class1[Prop] | Exclude<Class2[Prop], undefined>;
16
+ };
17
+ type MergePrototypes<ClassArray extends readonly unknown[]> = ClassArray extends [infer Class1] ? Class1 : ClassArray extends [infer Class1, ...infer Rest] ? MergePrototype<Class1, MergePrototypes<Rest>> : never;
18
+ interface RecursiveReadonlyArray<ItemType> extends ReadonlyArray<ItemType | RecursiveReadonlyArray<ItemType>> {
19
+ }
20
+ type EnumLike<Enum, Value> = Record<keyof Enum, Value>;
21
+ type If<Check, Value, True, False = never> = Check extends Value ? (Value extends Check ? True : False) : False;
22
+ type NonAbstract<Type extends abstract new (...args: any) => any> = Type extends abstract new (...args: infer Args) => infer Instance ? Pick<Type, keyof Type> & (new (...args: Args) => Instance) : never;
23
+ type Partialize<Type, Omitted extends keyof Type | ''> = Omit<Type, Omitted> & Partial<Pick<Type, Exclude<Omitted, ''>>>;
24
+
25
+ /**
26
+ * Data that can be resolved to give a bit field. This can be:
27
+ * A bit number (this can be a number literal or a value taken from {@link (BitField:class).Flags})
28
+ * A string bit number
29
+ * An instance of BitField
30
+ * An Array of BitFieldResolvable
31
+ */
32
+ type BitFieldResolvable<Flags extends string> = Flags | Readonly<BitField<Flags>> | RecursiveReadonlyArray<Flags | Readonly<BitField<Flags>> | bigint | number | `${bigint}`> | bigint | number | `${bigint}`;
33
+ /**
34
+ * Data structure that makes it easy to interact with a bit field.
35
+ */
36
+ declare abstract class BitField<Flags extends string> {
37
+ /**
38
+ * Numeric bit field flags.
39
+ *
40
+ * @remarks Defined in extension classes
41
+ */
42
+ static readonly Flags: EnumLike<unknown, bigint | number>;
43
+ static readonly DefaultBit: bigint;
44
+ /**
45
+ * Bitfield of the packed bits
46
+ */
47
+ bitField: bigint;
48
+ ['constructor']: NonAbstract<typeof BitField<Flags>>;
49
+ /**
50
+ * @param bits - Bit(s) to read from
51
+ */
52
+ constructor(bits?: BitFieldResolvable<Flags>);
53
+ /**
54
+ * Checks whether the bit field has a bit, or any of multiple bits.
55
+ *
56
+ * @param bit - Bit(s) to check for
57
+ * @returns Whether the bit field has the bit(s)
58
+ */
59
+ any(bit: BitFieldResolvable<Flags>): boolean;
60
+ /**
61
+ * Checks if this bit field equals another
62
+ *
63
+ * @param bit - Bit(s) to check for
64
+ * @returns Whether this bit field equals the other
65
+ */
66
+ equals(bit: BitFieldResolvable<Flags>): boolean;
67
+ /**
68
+ * Checks whether the bit field has a bit, or multiple bits.
69
+ *
70
+ * @param bit - Bit(s) to check for
71
+ * @returns Whether the bit field has the bit(s)
72
+ */
73
+ has(bit: BitFieldResolvable<Flags>, ..._hasParams: unknown[]): boolean;
74
+ /**
75
+ * Gets all given bits that are missing from the bit field.
76
+ *
77
+ * @param bits - Bit(s) to check for
78
+ * @param hasParams - Additional parameters for the has method, if any
79
+ * @returns A bit field containing the missing bits
80
+ */
81
+ missing(bits: BitFieldResolvable<Flags>, ...hasParams: readonly unknown[]): Flags[];
82
+ /**
83
+ * Freezes these bits, making them immutable.
84
+ *
85
+ * @returns This bit field but frozen
86
+ */
87
+ freeze(): Readonly<this>;
88
+ /**
89
+ * Adds bits to these ones.
90
+ *
91
+ * @param bits - Bits to add
92
+ * @returns These bits or new BitField if the instance is frozen.
93
+ */
94
+ add(...bits: BitFieldResolvable<Flags>[]): BitField<Flags>;
95
+ /**
96
+ * Removes bits from these.
97
+ *
98
+ * @param bits - Bits to remove
99
+ * @returns These bits or new BitField if the instance is frozen.
100
+ */
101
+ remove(...bits: BitFieldResolvable<Flags>[]): BitField<Flags>;
102
+ /**
103
+ * Gets an object mapping field names to a boolean indicating whether the bit is available.
104
+ *
105
+ * @param hasParams - Additional parameters for the has method, if any
106
+ * @returns An object mapping field names to a boolean indicating whether the bit is available
107
+ */
108
+ serialize(...hasParams: readonly unknown[]): Partial<Record<keyof Flags, boolean>>;
109
+ /**
110
+ * Gets an Array of bit field names based on the bits available.
111
+ *
112
+ * @param hasParams - Additional parameters for the has method, if any
113
+ * @returns An Array of bit field names
114
+ */
115
+ toArray(...hasParams: readonly unknown[]): Flags[];
116
+ toJSON(asNumber?: boolean): string | number;
117
+ valueOf(): bigint;
118
+ [Symbol.iterator](...hasParams: unknown[]): Generator<Flags, void, unknown>;
119
+ /**
120
+ * Resolves bit fields to their numeric form.
121
+ *
122
+ * @param bit - bit(s) to resolve
123
+ * @returns the numeric value of the bit fields
124
+ */
125
+ static resolve<Flags extends string = string>(bit: BitFieldResolvable<Flags>): bigint;
126
+ }
127
+
128
+ /**
129
+ * Data structure that makes it easy to interact with a {@link (Channel:class).flags} bitfield.
130
+ */
131
+ declare class ChannelFlagsBitField extends BitField<keyof ChannelFlags> {
132
+ /**
133
+ * Numeric guild channel flags.
134
+ */
135
+ static readonly Flags: typeof ChannelFlags;
136
+ toJSON(): string | number;
137
+ }
138
+
139
+ /**
140
+ * Data structure that makes it easy to interact with a permission bit field. All {@link GuildMember}s have a set of
141
+ * permissions in their guild, and each channel in the guild may also have {@link PermissionOverwrite}s for the member
142
+ * that override their default permissions.
143
+ */
144
+ declare class PermissionsBitField extends BitField<keyof typeof PermissionFlagsBits> {
145
+ /**
146
+ * Numeric permission flags.
147
+ *
148
+ * @see {@link https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags}
149
+ */
150
+ static Flags: {
151
+ readonly CreateInstantInvite: bigint;
152
+ readonly KickMembers: bigint;
153
+ readonly BanMembers: bigint;
154
+ readonly Administrator: bigint;
155
+ readonly ManageChannels: bigint;
156
+ readonly ManageGuild: bigint;
157
+ readonly AddReactions: bigint;
158
+ readonly ViewAuditLog: bigint;
159
+ readonly PrioritySpeaker: bigint;
160
+ readonly Stream: bigint;
161
+ readonly ViewChannel: bigint;
162
+ readonly SendMessages: bigint;
163
+ readonly SendTTSMessages: bigint;
164
+ readonly ManageMessages: bigint;
165
+ readonly EmbedLinks: bigint;
166
+ readonly AttachFiles: bigint;
167
+ readonly ReadMessageHistory: bigint;
168
+ readonly MentionEveryone: bigint;
169
+ readonly UseExternalEmojis: bigint;
170
+ readonly ViewGuildInsights: bigint;
171
+ readonly Connect: bigint;
172
+ readonly Speak: bigint;
173
+ readonly MuteMembers: bigint;
174
+ readonly DeafenMembers: bigint;
175
+ readonly MoveMembers: bigint;
176
+ readonly UseVAD: bigint;
177
+ readonly ChangeNickname: bigint;
178
+ readonly ManageNicknames: bigint;
179
+ readonly ManageRoles: bigint;
180
+ readonly ManageWebhooks: bigint;
181
+ readonly ManageEmojisAndStickers: bigint;
182
+ readonly ManageGuildExpressions: bigint;
183
+ readonly UseApplicationCommands: bigint;
184
+ readonly RequestToSpeak: bigint;
185
+ readonly ManageEvents: bigint;
186
+ readonly ManageThreads: bigint;
187
+ readonly CreatePublicThreads: bigint;
188
+ readonly CreatePrivateThreads: bigint;
189
+ readonly UseExternalStickers: bigint;
190
+ readonly SendMessagesInThreads: bigint;
191
+ readonly UseEmbeddedActivities: bigint;
192
+ readonly ModerateMembers: bigint;
193
+ readonly ViewCreatorMonetizationAnalytics: bigint;
194
+ readonly UseSoundboard: bigint;
195
+ readonly CreateGuildExpressions: bigint;
196
+ readonly CreateEvents: bigint;
197
+ readonly UseExternalSounds: bigint;
198
+ readonly SendVoiceMessages: bigint;
199
+ readonly SendPolls: bigint;
200
+ readonly UseExternalApps: bigint;
201
+ };
202
+ /**
203
+ * Bit field representing every permission combined
204
+ */
205
+ static readonly All: bigint;
206
+ /**
207
+ * Bit field representing the default permissions for users
208
+ */
209
+ static readonly Default = 104324673n;
210
+ /**
211
+ * Bit field representing the permissions required for moderators of stage channels
212
+ */
213
+ static readonly StageModerator: bigint;
214
+ /**
215
+ * Gets all given bits that are missing from the bit field.
216
+ *
217
+ * @param bits - Bit(s) to check for
218
+ * @param checkAdmin - Whether to allow the administrator permission to override
219
+ * @returns A bit field containing the missing permissions
220
+ */
221
+ missing(bits: BitFieldResolvable<keyof typeof PermissionFlagsBits>, checkAdmin?: boolean): ("CreateInstantInvite" | "KickMembers" | "BanMembers" | "Administrator" | "ManageChannels" | "ManageGuild" | "AddReactions" | "ViewAuditLog" | "PrioritySpeaker" | "Stream" | "ViewChannel" | "SendMessages" | "SendTTSMessages" | "ManageMessages" | "EmbedLinks" | "AttachFiles" | "ReadMessageHistory" | "MentionEveryone" | "UseExternalEmojis" | "ViewGuildInsights" | "Connect" | "Speak" | "MuteMembers" | "DeafenMembers" | "MoveMembers" | "UseVAD" | "ChangeNickname" | "ManageNicknames" | "ManageRoles" | "ManageWebhooks" | "ManageEmojisAndStickers" | "ManageGuildExpressions" | "UseApplicationCommands" | "RequestToSpeak" | "ManageEvents" | "ManageThreads" | "CreatePublicThreads" | "CreatePrivateThreads" | "UseExternalStickers" | "SendMessagesInThreads" | "UseEmbeddedActivities" | "ModerateMembers" | "ViewCreatorMonetizationAnalytics" | "UseSoundboard" | "CreateGuildExpressions" | "CreateEvents" | "UseExternalSounds" | "SendVoiceMessages" | "SendPolls" | "UseExternalApps")[];
222
+ /**
223
+ * Checks whether the bit field has a permission, or any of multiple permissions.
224
+ *
225
+ * @param permission - Permission(s) to check for
226
+ * @param checkAdmin - Whether to allow the administrator permission to override
227
+ * @returns Whether the bit field has the permission(s)
228
+ */
229
+ any(permission: BitFieldResolvable<keyof typeof PermissionFlagsBits>, checkAdmin?: boolean): boolean;
230
+ /**
231
+ * Checks whether the bit field has a permission, or multiple permissions.
232
+ *
233
+ * @param permission - Permission(s) to check for
234
+ * @param checkAdmin - Whether to allow the administrator permission to override
235
+ * @returns Whether the bit field has the permission(s)
236
+ */
237
+ has(permission: BitFieldResolvable<keyof typeof PermissionFlagsBits>, checkAdmin?: boolean): boolean;
238
+ /**
239
+ * Gets an Array of bitfield names based on the permissions available.
240
+ *
241
+ * @returns An Array of permission names
242
+ */
243
+ toArray(): ("CreateInstantInvite" | "KickMembers" | "BanMembers" | "Administrator" | "ManageChannels" | "ManageGuild" | "AddReactions" | "ViewAuditLog" | "PrioritySpeaker" | "Stream" | "ViewChannel" | "SendMessages" | "SendTTSMessages" | "ManageMessages" | "EmbedLinks" | "AttachFiles" | "ReadMessageHistory" | "MentionEveryone" | "UseExternalEmojis" | "ViewGuildInsights" | "Connect" | "Speak" | "MuteMembers" | "DeafenMembers" | "MoveMembers" | "UseVAD" | "ChangeNickname" | "ManageNicknames" | "ManageRoles" | "ManageWebhooks" | "ManageEmojisAndStickers" | "ManageGuildExpressions" | "UseApplicationCommands" | "RequestToSpeak" | "ManageEvents" | "ManageThreads" | "CreatePublicThreads" | "CreatePrivateThreads" | "UseExternalStickers" | "SendMessagesInThreads" | "UseEmbeddedActivities" | "ModerateMembers" | "ViewCreatorMonetizationAnalytics" | "UseSoundboard" | "CreateGuildExpressions" | "CreateEvents" | "UseExternalSounds" | "SendVoiceMessages" | "SendPolls" | "UseExternalApps")[];
244
+ }
245
+
246
+ declare const kData: unique symbol;
247
+ declare const kClone: unique symbol;
248
+ declare const kPatch: unique symbol;
249
+ declare const kExpiresTimestamp: unique symbol;
250
+ declare const kCreatedTimestamp: unique symbol;
251
+ declare const kArchiveTimestamp: unique symbol;
252
+ declare const kAllow: unique symbol;
253
+ declare const kDeny: unique symbol;
254
+ declare const kLastPinTimestamp: unique symbol;
255
+ declare const kMixinConstruct: unique symbol;
256
+ declare const kMixinToJSON: unique symbol;
257
+
258
+ declare const DataTemplatePropertyName = "DataTemplate";
259
+ declare const OptimizeDataPropertyName = "optimizeData";
260
+ /**
261
+ * Represents a data model from the Discord API
262
+ *
263
+ * @privateRemarks
264
+ * Explanation of the type complexity surround Structure:
265
+ *
266
+ * There are two layers of Omitted generics, one here, which allows omitting things at the library level so we do not accidentally
267
+ * access them, in addition to whatever the user does at the layer above.
268
+ *
269
+ * The second layer, in the exported structure is effectively a type cast that allows the getters types to match whatever data template is used
270
+ *
271
+ * In order to safely set and access this data, the constructor and patch take data as "partial" and forcibly assigns it to kData. To accommodate this,
272
+ * kData stores properties as `unknown` when it is omitted, which allows accessing the property in getters even when it may not actually be present.
273
+ * This is the most technically correct way of representing the value, especially since there is no way to guarantee runtime matches the "type cast."
274
+ */
275
+ declare abstract class Structure<DataType extends {}, Omitted extends keyof DataType | '' = ''> {
276
+ /**
277
+ * A construct function used when mixing to allow mixins to set optimized property defaults
278
+ *
279
+ * @internal
280
+ * @remarks This should only be used to set defaults, setting optimized values should be done
281
+ * in the mixins `optimizeData` method, which will be called automatically.
282
+ * @param data - The full API data received by the Structure
283
+ */
284
+ protected [kMixinConstruct]?(data: Partial<DataType>): void;
285
+ /**
286
+ * A function used when mixing to allow mixins to add properties to the result of toJSON
287
+ *
288
+ * @internal
289
+ * @remarks This should only be used to add properties that the mixin optimizes, if the raw
290
+ * JSON data is unchanged the property will already be returned.
291
+ * @param data - The result of the base class toJSON Structure before it gets returned
292
+ */
293
+ protected [kMixinToJSON]?(data: Partial<DataType>): void;
294
+ /**
295
+ * The template used for removing data from the raw data stored for each Structure.
296
+ *
297
+ * @remarks This template should be overridden in all subclasses to provide more accurate type information.
298
+ * The template in the base {@link Structure} class will have no effect on most subclasses for this reason.
299
+ */
300
+ protected static readonly DataTemplate: Record<string, unknown>;
301
+ /**
302
+ * @returns A cloned version of the data template, ready to create a new data object.
303
+ */
304
+ private getDataTemplate;
305
+ /**
306
+ * The raw data from the API for this structure
307
+ *
308
+ * @internal
309
+ */
310
+ protected [kData]: Readonly<ReplaceOmittedWithUnknown<Omitted, DataType>>;
311
+ /**
312
+ * Creates a new structure to represent API data
313
+ *
314
+ * @param data - the data from the API that this structure will represent
315
+ * @remarks To be made public in subclasses
316
+ * @internal
317
+ */
318
+ constructor(data: Readonly<Partial<DataType>>, ..._rest: unknown[]);
319
+ /**
320
+ * Patches the raw data of this object in place
321
+ *
322
+ * @param data - the updated data from the API to patch with
323
+ * @remarks To be made public in subclasses
324
+ * @returns this
325
+ * @internal
326
+ */
327
+ protected [kPatch](data: Readonly<Partial<DataType>>): this;
328
+ /**
329
+ * Creates a clone of this structure
330
+ *
331
+ * @returns a clone of this
332
+ * @internal
333
+ */
334
+ protected [kClone](patchPayload?: Readonly<Partial<DataType>>): typeof this;
335
+ /**
336
+ * Function called to ensure stored raw data is in optimized formats, used in tandem with a data template
337
+ *
338
+ * @example created_timestamp is an ISO string, this can be stored in optimized form as a number
339
+ * @param _data - the raw data received from the API to optimize
340
+ * @remarks Implementation to be done in subclasses and mixins where needed.
341
+ * For typescript users, mixins must use the closest ancestors access modifier.
342
+ * @remarks Automatically called in Structure[kPatch] but must be called manually in the constructor
343
+ * of any class implementing this method.
344
+ * @remarks Additionally, when implementing, ensure to call `super._optimizeData` if any class in the super chain aside
345
+ * from Structure contains an implementation.
346
+ * Note: mixins do not need to call super ever as the process of mixing walks the prototype chain.
347
+ * @virtual
348
+ * @internal
349
+ */
350
+ protected optimizeData(_data: Partial<DataType>): void;
351
+ /**
352
+ * Transforms this object to its JSON format with raw API data (or close to it),
353
+ * automatically called by `JSON.stringify()` when this structure is stringified
354
+ *
355
+ * @remarks
356
+ * The type of this data is determined by omissions at runtime and is only guaranteed for default omissions
357
+ * @privateRemarks
358
+ * When omitting properties at the library level, this must be overridden to re-add those properties
359
+ */
360
+ toJSON(): DataType;
361
+ }
362
+
363
+ interface ChannelPermissionMixin<Type extends Exclude<GuildChannelType, ChannelType.GuildDirectory | ThreadChannelType> = Exclude<GuildChannelType, ChannelType.GuildDirectory | ThreadChannelType>> extends Channel<Type> {
364
+ }
365
+ /**
366
+ * @remarks has an array of sub-structures {@link PermissionOverwrite} that extending mixins should add to their DataTemplate and _optimizeData
367
+ */
368
+ declare class ChannelPermissionMixin<Type extends Exclude<GuildChannelType, ChannelType.GuildDirectory | ThreadChannelType> = Exclude<GuildChannelType, ChannelType.GuildDirectory | ThreadChannelType>> {
369
+ /**
370
+ * The sorting position of the channel
371
+ */
372
+ get position(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["position"];
373
+ /**
374
+ * Indicates whether this channel can have permission overwrites
375
+ */
376
+ isPermissionCapable(): this is ChannelPermissionMixin & this;
377
+ }
378
+
379
+ interface ChannelWebhookMixin<Type extends ChannelType.GuildForum | ChannelType.GuildMedia | Exclude<GuildTextChannelType, ThreadChannelType> = ChannelType.GuildForum | ChannelType.GuildMedia | Exclude<GuildTextChannelType, ThreadChannelType>> extends Channel<Type> {
380
+ }
381
+ declare class ChannelWebhookMixin<Type extends ChannelType.GuildForum | ChannelType.GuildMedia | Exclude<GuildTextChannelType, ThreadChannelType> = ChannelType.GuildForum | ChannelType.GuildMedia | Exclude<GuildTextChannelType, ThreadChannelType>> {
382
+ /**
383
+ * Indicates whether this channel can have webhooks
384
+ */
385
+ isWebhookCapable(): this is ChannelWebhookMixin & this;
386
+ }
387
+
388
+ interface DMChannelMixin<Type extends ChannelType.DM | ChannelType.GroupDM = ChannelType.DM | ChannelType.GroupDM> extends Channel<Type> {
389
+ }
390
+ /**
391
+ * @remarks has recipients, an array of sub-structures {@link User} that extending mixins should add to their DataTemplate and _optimizeData
392
+ */
393
+ declare class DMChannelMixin<Type extends ChannelType.DM | ChannelType.GroupDM = ChannelType.DM | ChannelType.GroupDM> {
394
+ /**
395
+ * The URL to this channel.
396
+ */
397
+ get url(): `https://discord.com/channels/@me/${ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["id"]}`;
398
+ /**
399
+ * Indicates whether this channel is a DM or DM Group
400
+ */
401
+ isDMBased(): this is DMChannelMixin & this;
402
+ }
403
+
404
+ interface GuildChannelMixin<Type extends GuildChannelType = GuildChannelType> extends Channel<Type> {
405
+ }
406
+ declare class GuildChannelMixin<Type extends GuildChannelType = GuildChannelType> {
407
+ /**
408
+ * The flags that are applied to the channel.
409
+ *
410
+ * @privateRemarks The type of `flags` can be narrowed in Guild Channels and DMChannel to ChannelFlags, and in GroupDM channel
411
+ * to null, respecting Omit behaviors
412
+ */
413
+ get flags(): ChannelFlagsBitField | null;
414
+ /**
415
+ * THe id of the guild this channel is in.
416
+ */
417
+ get guildId(): NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["guild_id"]>;
418
+ /**
419
+ * The URL to this channel.
420
+ */
421
+ get url(): `https://discord.com/channels/${NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["guild_id"]>}/${ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["id"]}`;
422
+ /**
423
+ * Indicates whether this channel is in a guild
424
+ */
425
+ isGuildBased(): this is GuildChannelMixin & this;
426
+ }
427
+
428
+ interface TextChannelMixin<Type extends TextChannelType = TextChannelType> extends Channel<Type> {
429
+ }
430
+ declare class TextChannelMixin<Type extends TextChannelType = TextChannelType> {
431
+ /**
432
+ * The id of the last message sent in this channel.
433
+ */
434
+ get lastMessageId(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["last_message_id"] | undefined;
435
+ /**
436
+ * Indicates whether this channel can contain messages
437
+ */
438
+ isTextBased(): this is TextChannelMixin & this;
439
+ }
440
+
441
+ interface ThreadChannelMixin<Type extends ThreadChannelType = ThreadChannelType> extends Channel<Type> {
442
+ }
443
+ /**
444
+ * @remarks has a sub-structure {@link ThreadMetadata} that extending mixins should add to their DataTemplate and _optimizeData
445
+ */
446
+ declare class ThreadChannelMixin<Type extends ThreadChannelType = ThreadChannelType> {
447
+ /**
448
+ * The approximate count of users in a thread, stops counting at 50
449
+ */
450
+ get memberCount(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["member_count"] | undefined;
451
+ /**
452
+ * The number of messages (not including the initial message or deleted messages) in a thread.
453
+ */
454
+ get messageCount(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["message_count"] | undefined;
455
+ /**
456
+ * The number of messages ever sent in a thread, it's similar to message_count on message creation,
457
+ * but will not decrement the number when a message is deleted.
458
+ */
459
+ get totalMessageSent(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["total_message_sent"] | undefined;
460
+ /**
461
+ * Indicates whether this channel is a thread channel
462
+ */
463
+ isThread(): this is ThreadChannelMixin & this;
464
+ }
465
+
466
+ interface ThreadOnlyChannelMixin<Type extends ChannelType.GuildForum | ChannelType.GuildMedia = ChannelType.GuildForum | ChannelType.GuildMedia> extends Channel<Type> {
467
+ }
468
+ /**
469
+ * @remarks has an array of sub-structures {@link ForumTag} that extending mixins should add to their DataTemplate and _optimizeData
470
+ */
471
+ declare class ThreadOnlyChannelMixin<Type extends ChannelType.GuildForum | ChannelType.GuildMedia = ChannelType.GuildForum | ChannelType.GuildMedia> {
472
+ /**
473
+ * The emoji to show in the add reaction button on a thread in this channel.
474
+ */
475
+ get defaultReactionEmoji(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["default_reaction_emoji"];
476
+ /**
477
+ * The default sort order type used to order posts in this channel.
478
+ *
479
+ * @defaultValue `null` – indicates a preferred sort order hasn't been set.
480
+ */
481
+ get defaultSortOrder(): NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["default_sort_order"]>;
482
+ /**
483
+ * Indicates whether this channel only allows thread creation
484
+ */
485
+ isThreadOnly(): this is ThreadOnlyChannelMixin & this;
486
+ }
487
+
488
+ interface VoiceChannelMixin<Type extends ChannelType.GuildStageVoice | ChannelType.GuildVoice = ChannelType.GuildStageVoice | ChannelType.GuildVoice> extends Channel<Type> {
489
+ }
490
+ declare class VoiceChannelMixin<Type extends ChannelType.GuildStageVoice | ChannelType.GuildVoice = ChannelType.GuildStageVoice | ChannelType.GuildVoice> extends TextChannelMixin<Type> {
491
+ /**
492
+ * The bitrate (in bits) of the voice channel.
493
+ */
494
+ get bitrate(): NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["bitrate"]>;
495
+ /**
496
+ * The voice region id for this channel, automatic when set to null.
497
+ */
498
+ get rtcRegion(): NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["rtc_region"]>;
499
+ /**
500
+ * The camera video quality mode of the voice channel, {@link discord-api-types/v10#(VideoQualityMode:enum) | Auto} when not present.
501
+ */
502
+ get videoQualityMode(): NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["video_quality_mode"]>;
503
+ /**
504
+ * The user limit of the voice channel.
505
+ */
506
+ get userLimit(): NonNullable<ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["user_limit"]>;
507
+ /**
508
+ * Indicates whether this channel has voice connection capabilities
509
+ */
510
+ isVoiceBased(): this is VoiceChannelMixin & this;
511
+ }
512
+
513
+ type PartialChannel = Channel<ChannelType, Exclude<keyof APIChannel, keyof APIPartialChannel>>;
514
+ /**
515
+ * The data stored by a {@link Channel} structure based on its {@link (Channel:class)."type"} property.
516
+ */
517
+ type ChannelDataType<Type extends ChannelType | 'unknown'> = Type extends ChannelType ? Extract<APIChannel, {
518
+ type: Type;
519
+ }> : APIPartialChannel;
520
+ /**
521
+ * Represents any channel on Discord.
522
+ *
523
+ * @typeParam Type - Specify the type of the channel being constructed for more accurate data types
524
+ * @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
525
+ * @remarks Although this class _can_ be instantiated directly for any channel type,
526
+ * it's intended to be subclassed with the appropriate mixins for each channel type.
527
+ */
528
+ declare class Channel<Type extends ChannelType | 'unknown' = ChannelType, Omitted extends keyof ChannelDataType<Type> | '' = ''> extends Structure<ChannelDataType<Type>, Omitted> {
529
+ /**
530
+ * The template used for removing data from the raw data stored for each Channel.
531
+ *
532
+ * @remarks This template is only guaranteed to apply to channels constructed directly via `new Channel()`.
533
+ * Use the appropriate subclass template to remove data from that channel type.
534
+ */
535
+ static readonly DataTemplate: Partial<APIChannel>;
536
+ /**
537
+ * @param data - The raw data received from the API for the channel
538
+ */
539
+ constructor(data: Partialize<ChannelDataType<Type>, Omitted>);
540
+ /**
541
+ * {@inheritDoc Structure.[kPatch]}
542
+ *
543
+ * @internal
544
+ */
545
+ [kPatch](data: Partial<ChannelDataType<Type>>): this;
546
+ /**
547
+ * The id of the channel
548
+ */
549
+ get id(): ReplaceOmittedWithUnknown<Omitted, ChannelDataType<Type>>["id"];
550
+ /**
551
+ * The type of the channel
552
+ */
553
+ get type(): Type extends "unknown" ? number : Type;
554
+ /**
555
+ * The name of the channel, null for DMs
556
+ *
557
+ * @privateRemarks The type of `name` can be narrowed in Guild Channels and DM channels to string and null respectively,
558
+ * respecting Omit behaviors
559
+ */
560
+ get name(): ReplaceOmittedWithUnknown<Omitted, ChannelDataType<Type>>["name"] | undefined;
561
+ /**
562
+ * The flags that are applied to the channel.
563
+ *
564
+ * @privateRemarks The type of `flags` can be narrowed in Guild Channels and DMChannel to ChannelFlags, and in GroupDM channel
565
+ * to null, respecting Omit behaviors
566
+ */
567
+ get flags(): ChannelFlagsBitField | null;
568
+ /**
569
+ * The timestamp the channel was created at
570
+ */
571
+ get createdTimestamp(): number | null;
572
+ /**
573
+ * The time the channel was created at
574
+ */
575
+ get createdAt(): Date | null;
576
+ /**
577
+ * Indicates whether this channel is a thread channel
578
+ *
579
+ * @privateRemarks Overridden to `true` on `ThreadChannelMixin`
580
+ */
581
+ isThread(): this is ThreadChannelMixin & this;
582
+ /**
583
+ * Indicates whether this channel can contain messages
584
+ *
585
+ * @privateRemarks Overridden to `true` on `TextChannelMixin`
586
+ */
587
+ isTextBased(): this is TextChannelMixin & this;
588
+ /**
589
+ * Indicates whether this channel is in a guild
590
+ *
591
+ * @privateRemarks Overridden to `true` on `GuildChannelMixin`
592
+ */
593
+ isGuildBased(): this is GuildChannelMixin & this;
594
+ /**
595
+ * Indicates whether this channel is a DM or DM Group
596
+ *
597
+ * @privateRemarks Overridden to `true` on `DMChannelMixin`
598
+ */
599
+ isDMBased(): this is DMChannelMixin & this;
600
+ /**
601
+ * Indicates whether this channel has voice connection capabilities
602
+ *
603
+ * @privateRemarks Overridden to `true` on `VoiceChannelMixin`
604
+ */
605
+ isVoiceBased(): this is VoiceChannelMixin & this;
606
+ /**
607
+ * Indicates whether this channel only allows thread creation
608
+ *
609
+ * @privateRemarks Overridden to `true` on `ThreadOnlyChannelMixin`
610
+ */
611
+ isThreadOnly(): this is ThreadOnlyChannelMixin & this;
612
+ /**
613
+ * Indicates whether this channel can have permission overwrites
614
+ *
615
+ * @privateRemarks Overridden to `true` on `ChannelPermissionsMixin`
616
+ */
617
+ isPermissionCapable(): this is ChannelPermissionMixin & this;
618
+ /**
619
+ * Indicates whether this channel can have webhooks
620
+ *
621
+ * @privateRemarks Overridden to `true` on `ChannelWebhooksMixin`
622
+ */
623
+ isWebhookCapable(): this is ChannelWebhookMixin & this;
624
+ }
625
+
626
+ interface AppliedTagsMixin extends Channel<ChannelType.PublicThread> {
627
+ }
628
+ declare class AppliedTagsMixin {
629
+ /**
630
+ * The ids of the set of tags that have been applied to a thread in a {@link (ForumChannel:class)} or a {@link (MediaChannel:class)}.
631
+ */
632
+ get appliedTags(): readonly string[] | null;
633
+ }
634
+
635
+ interface ChannelOwnerMixin<Type extends ChannelType.GroupDM | ThreadChannelType> extends Channel<Type> {
636
+ }
637
+ declare class ChannelOwnerMixin<Type extends ChannelType.GroupDM | ThreadChannelType> {
638
+ /**
639
+ * The id of the creator of the group DM or thread
640
+ */
641
+ get ownerId(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["owner_id"] | undefined;
642
+ }
643
+
644
+ declare class ChannelParentMixin<Type extends Exclude<GuildChannelType, ChannelType.GuildCategory | ChannelType.GuildDirectory>> extends GuildChannelMixin<Type> {
645
+ /**
646
+ * The id of the parent category for a channel (each parent category can contain up to 50 channels) or id of the parent channel for a thread
647
+ */
648
+ get parentId(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["parent_id"] | undefined;
649
+ /**
650
+ * Whether the channel is nsfw
651
+ */
652
+ get nsfw(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["nsfw"] | undefined;
653
+ }
654
+
655
+ interface ChannelPinMixin<Type extends ChannelType.DM | ChannelType.GuildAnnouncement | ChannelType.GuildText | ThreadChannelType> extends Channel<Type> {
656
+ }
657
+ declare class ChannelPinMixin<Type extends ChannelType.DM | ChannelType.GuildAnnouncement | ChannelType.GuildText | ThreadChannelType> {
658
+ /**
659
+ * The timestamp of when the last pin in the channel happened
660
+ */
661
+ protected [kLastPinTimestamp]: number | null;
662
+ /**
663
+ * The template used for removing data from the raw data stored for each Channel.
664
+ */
665
+ static readonly DataTemplate: Partial<ChannelDataType<ChannelType.DM | ChannelType.GuildAnnouncement | ChannelType.GuildText | ThreadChannelType>>;
666
+ [kMixinConstruct](): void;
667
+ /**
668
+ * {@inheritDoc Structure.optimizeData}
669
+ */
670
+ protected optimizeData(data: Partial<ChannelDataType<Type>>): void;
671
+ /**
672
+ * The timestamp of when the last pin in the channel happened.
673
+ */
674
+ get lastPinTimestamp(): number | null;
675
+ /**
676
+ * The Date of when the last pin in the channel happened
677
+ */
678
+ get lastPinAt(): Date | null;
679
+ /**
680
+ * Adds data from optimized properties omitted from [kData].
681
+ *
682
+ * @param data - the result of {@link (Structure:class).toJSON}
683
+ */
684
+ protected [kMixinToJSON](data: Partial<ChannelDataType<Type>>): void;
685
+ }
686
+
687
+ declare class ChannelSlowmodeMixin<Type extends GuildTextChannelType> extends TextChannelMixin<Type> {
688
+ /**
689
+ * The rate limit per user (slowmode) of this channel.
690
+ */
691
+ get rateLimitPerUser(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["rate_limit_per_user"] | undefined;
692
+ }
693
+
694
+ interface ChannelTopicMixin<Type extends ChannelType.GuildAnnouncement | ChannelType.GuildForum | ChannelType.GuildMedia | ChannelType.GuildText> extends Channel<Type> {
695
+ }
696
+ declare class ChannelTopicMixin<Type extends ChannelType.GuildAnnouncement | ChannelType.GuildForum | ChannelType.GuildMedia | ChannelType.GuildText> extends ChannelWebhookMixin<Type> {
697
+ /**
698
+ * The topic of this channel.
699
+ */
700
+ get topic(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["topic"] | undefined;
701
+ /**
702
+ * The duration after which new threads get archived by default on this channel.
703
+ */
704
+ get defaultAutoArchiveDuration(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["default_auto_archive_duration"] | undefined;
705
+ /**
706
+ * The default value for rate limit per user (slowmode) on new threads in this channel.
707
+ */
708
+ get defaultThreadRateLimitPerUser(): ReplaceOmittedWithUnknown<"", ChannelDataType<Type>>["default_thread_rate_limit_per_user"] | undefined;
709
+ }
710
+
711
+ interface GroupDMMixin extends Channel<ChannelType.GroupDM> {
712
+ }
713
+ declare class GroupDMMixin {
714
+ /**
715
+ * The icon hash of the group DM.
716
+ */
717
+ get icon(): string | null | undefined;
718
+ /**
719
+ * Whether the channel is managed by an application via the `gdm.join` OAuth2 scope.
720
+ */
721
+ get managed(): boolean | undefined;
722
+ /**
723
+ * The application id of the group DM creator if it is bot-created.
724
+ */
725
+ get applicationId(): string | undefined;
726
+ }
727
+
728
+ /**
729
+ * Represents metadata of a thread channel on Discord.
730
+ *
731
+ * @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
732
+ */
733
+ declare class ForumTag<Omitted extends keyof APIGuildForumTag | '' = ''> extends Structure<APIGuildForumTag, Omitted> {
734
+ constructor(data: Partialize<APIGuildForumTag, Omitted>);
735
+ /**
736
+ * The id of the tag.
737
+ */
738
+ get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIGuildForumTag[T] : never : never;
739
+ /**
740
+ * The name of the tag.
741
+ */
742
+ get name(): "name" extends infer T ? T extends "name" ? T extends Omitted ? unknown : APIGuildForumTag[T] : never : never;
743
+ /**
744
+ * Whether this tag can only be added to or removed from threads by a member with the {@link discord-api-types/v10#(PermissionFlagsBits:variable) | ManageThreads} permission.
745
+ */
746
+ get moderated(): "moderated" extends infer T ? T extends "moderated" ? T extends Omitted ? unknown : APIGuildForumTag[T] : never : never;
747
+ /**
748
+ * The id of a guild's custom emoji.
749
+ */
750
+ get emojiId(): "emoji_id" extends infer T ? T extends "emoji_id" ? T extends Omitted ? unknown : APIGuildForumTag[T] : never : never;
751
+ /**
752
+ * The unicode character of the emoji.
753
+ */
754
+ get emojiName(): "emoji_name" extends infer T ? T extends "emoji_name" ? T extends Omitted ? unknown : APIGuildForumTag[T] : never : never;
755
+ /**
756
+ * The textual representation of this tag's emoji. Either a unicode character or a guild emoji mention.
757
+ */
758
+ get emoji(): string | NonNullable<"emoji_name" extends infer T ? T extends "emoji_name" ? T extends Omitted ? unknown : APIGuildForumTag[T] : never : never>;
759
+ }
760
+
761
+ /**
762
+ * Represents metadata of a thread channel on Discord.
763
+ *
764
+ * @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
765
+ */
766
+ declare class PermissionOverwrite<Omitted extends keyof APIOverwrite | '' = 'allow' | 'deny'> extends Structure<APIOverwrite, Omitted> {
767
+ protected [kAllow]: bigint | null;
768
+ protected [kDeny]: bigint | null;
769
+ constructor(data: Partialize<APIOverwrite, Omitted>);
770
+ /**
771
+ * The template used for removing data from the raw data stored for each ThreadMetadata
772
+ *
773
+ * @remarks This template has defaults, if you want to remove additional data and keep the defaults,
774
+ * use `Object.defineProperties`. To override the defaults, set this value directly.
775
+ */
776
+ static readonly DataTemplate: Partial<APIOverwrite>;
777
+ /**
778
+ * {@inheritDoc Structure.optimizeData}
779
+ */
780
+ protected optimizeData(data: Partial<APIOverwrite>): void;
781
+ /**
782
+ * The permission bit set allowed by this overwrite.
783
+ */
784
+ get allow(): PermissionsBitField | null;
785
+ /**
786
+ * The permission bit set denied by this overwrite.
787
+ */
788
+ get deny(): PermissionsBitField | null;
789
+ /**
790
+ * The role or user id for this overwrite.
791
+ */
792
+ get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIOverwrite[T] : never : never;
793
+ /**
794
+ * The type of this overwrite.
795
+ */
796
+ get type(): "type" extends infer T ? T extends "type" ? T extends Omitted ? unknown : APIOverwrite[T] : never : never;
797
+ /**
798
+ * {@inheritDoc Structure.toJSON}
799
+ */
800
+ toJSON(): APIOverwrite;
801
+ }
802
+
803
+ /**
804
+ * Represents metadata of a thread channel on Discord.
805
+ *
806
+ * @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
807
+ */
808
+ declare class ThreadMetadata<Omitted extends keyof APIThreadMetadata | '' = 'archive_timestamp' | 'create_timestamp'> extends Structure<APIThreadMetadata, Omitted> {
809
+ protected [kArchiveTimestamp]: number | null;
810
+ protected [kCreatedTimestamp]: number | null;
811
+ constructor(data: Partialize<APIThreadMetadata, Omitted>);
812
+ /**
813
+ * The template used for removing data from the raw data stored for each ThreadMetadata
814
+ *
815
+ * @remarks This template has defaults, if you want to remove additional data and keep the defaults,
816
+ * use `Object.defineProperties`. To override the defaults, set this value directly.
817
+ */
818
+ static readonly DataTemplate: Partial<APIThreadMetadata>;
819
+ /**
820
+ * {@inheritDoc Structure.optimizeData}
821
+ */
822
+ protected optimizeData(data: Partial<APIThreadMetadata>): void;
823
+ /**
824
+ * Whether the thread is archived.
825
+ */
826
+ get archived(): "archived" extends infer T ? T extends "archived" ? T extends Omitted ? unknown : APIThreadMetadata[T] : never : never;
827
+ /**
828
+ * The timestamp when the thread's archive status was last changed, used for calculating recent activity.
829
+ */
830
+ get archivedTimestamp(): number | null;
831
+ /**
832
+ * The timestamp when the thread was created; only populated for threads created after 2022-01-09.
833
+ */
834
+ get createdTimestamp(): number | null;
835
+ /**
836
+ * The thread will stop showing in the channel list after auto_archive_duration minutes of inactivity,
837
+ */
838
+ get autoArchiveDuration(): "auto_archive_duration" extends infer T ? T extends "auto_archive_duration" ? T extends Omitted ? unknown : APIThreadMetadata[T] : never : never;
839
+ /**
840
+ * Whether non-moderators can add other non-moderators to a thread; only available on private threads.
841
+ */
842
+ get invitable(): ("invitable" extends infer T ? T extends "invitable" ? T extends Omitted ? unknown : APIThreadMetadata[T] : never : never) | undefined;
843
+ /**
844
+ * Whether the thread is locked; when a thread is locked, only users with {@link discord-api-types/v10#(PermissionFlagsBits:variable) | ManageThreads} can unarchive it.
845
+ */
846
+ get locked(): "locked" extends infer T ? T extends "locked" ? T extends Omitted ? unknown : APIThreadMetadata[T] : never : never;
847
+ /**
848
+ * The time the thread was archived at
849
+ */
850
+ get archivedAt(): Date | null;
851
+ /**
852
+ * The time the thread was created at
853
+ */
854
+ get createdAt(): Date | null;
855
+ /**
856
+ * {@inheritDoc Structure.toJSON}
857
+ */
858
+ toJSON(): APIThreadMetadata;
859
+ }
860
+
861
+ type Mixinable<ClassType> = new (...args: unknown[]) => ClassType;
862
+ type MixinBase<BaseClass extends Structure<{}>> = BaseClass extends Structure<infer DataType, infer Omitted> ? Structure<DataType, Omitted> : never;
863
+ /**
864
+ * Copies the prototype (getters, setters, and methods) of all mixins to the destination class.
865
+ * For type information see {@link MixinTypes}
866
+ *
867
+ * @param destination - The class to apply the mixins to, must extend the base that the mixins expect it to.
868
+ * @param mixins - Classes that contain "pure" prototypes to be copied on top of the destination class prototype
869
+ * @remarks All mixins should be "pure" in that they only contain getters, setters, and methods.
870
+ * The runtime code will only copy these, and adding properties to the class only results
871
+ * in the types of the mixed class being wrong.
872
+ * @example
873
+ * ```
874
+ * // Interface merging on the mixin to give type access to props on the base and kData that are available once copied
875
+ * interface TextMixin extends Channel {}
876
+ * class TextMixin {
877
+ * // Methods / getters
878
+ * }
879
+ *
880
+ * // Interface merging on the mixed class to give it accurate type information within the declaration and when instantiated
881
+ * interface TextChannel extends MixinTypes<Channel, [TextMixin]> {}
882
+ * class TextChannel extends Channel {}
883
+ *
884
+ * // Apply for runtime
885
+ * Mixin(TextChannel, [TextMixin])
886
+ * ```
887
+ * @typeParam DestinationClass - The class to be mixed, ensures that the mixins provided can be used with this destination
888
+ */
889
+ declare function Mixin<DestinationClass extends typeof Structure<{}>>(destination: DestinationClass, mixins: Mixinable<MixinBase<DestinationClass['prototype']>>[]): void;
890
+
891
+ /**
892
+ * Type utility to provide accurate types for the runtime effects of {@link Mixin}
893
+ *
894
+ * @typeParam BaseClass - The class that is being directly extended, must match the class that the mixins are expecting
895
+ * @typeParam Mixins - The mixins that will be applied to this class via a {@link Mixin} call
896
+ */
897
+ type MixinTypes<BaseClass extends Structure<{}>, Mixins extends readonly MixinBase<BaseClass>[]> = CollapseUnion<
898
+ BaseClass extends Structure<infer DataType, infer Omitted>
899
+ ? Mixins[number] extends Structure<DataType, Omitted>
900
+ ? // prettier-ignore
901
+ Structure<DataType, Omitted>[typeof kData] extends
902
+ // @ts-expect-error kData is protected
903
+ Mixins[number][typeof kData]
904
+ ? Omit<MergePrototypes<Mixins>, keyof BaseClass | typeof kMixinConstruct>
905
+ : never
906
+ : never
907
+ : never
908
+ >;
909
+
910
+ interface AnnouncementChannel<Omitted extends keyof APINewsChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildAnnouncement>, [
911
+ TextChannelMixin<ChannelType.GuildAnnouncement>,
912
+ ChannelParentMixin<ChannelType.GuildAnnouncement>,
913
+ ChannelPermissionMixin<ChannelType.GuildAnnouncement>,
914
+ ChannelPinMixin<ChannelType.GuildAnnouncement>,
915
+ ChannelSlowmodeMixin<ChannelType.GuildAnnouncement>,
916
+ ChannelTopicMixin<ChannelType.GuildAnnouncement>
917
+ ]> {
918
+ }
919
+ /**
920
+ * Sample Implementation of a structure for announcement channels, usable by direct end consumers.
921
+ */
922
+ declare class AnnouncementChannel<Omitted extends keyof APINewsChannel | '' = ''> extends Channel<ChannelType.GuildAnnouncement, Omitted> {
923
+ constructor(data: Partialize<APINewsChannel, Omitted>);
924
+ }
925
+
926
+ interface AnnouncementThreadChannel<Omitted extends keyof APIAnnouncementThreadChannel | '' = ''> extends MixinTypes<Channel<ChannelType.AnnouncementThread>, [
927
+ TextChannelMixin<ChannelType.AnnouncementThread>,
928
+ ChannelOwnerMixin<ChannelType.AnnouncementThread>,
929
+ ChannelParentMixin<ChannelType.AnnouncementThread>,
930
+ ChannelPinMixin<ChannelType.AnnouncementThread>,
931
+ ChannelSlowmodeMixin<ChannelType.AnnouncementThread>,
932
+ GuildChannelMixin<ChannelType.AnnouncementThread>,
933
+ ThreadChannelMixin<ChannelType.AnnouncementThread>
934
+ ]> {
935
+ }
936
+ /**
937
+ * Sample Implementation of a structure for announcement threads, usable by direct end consumers.
938
+ */
939
+ declare class AnnouncementThreadChannel<Omitted extends keyof APIAnnouncementThreadChannel | '' = ''> extends Channel<ChannelType.AnnouncementThread, Omitted> {
940
+ constructor(data: Partialize<APIAnnouncementThreadChannel, Omitted>);
941
+ }
942
+
943
+ interface CategoryChannel<Omitted extends keyof APIGuildCategoryChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildCategory>, [
944
+ ChannelPermissionMixin<ChannelType.GuildCategory>,
945
+ GuildChannelMixin<ChannelType.GuildCategory>
946
+ ]> {
947
+ }
948
+ /**
949
+ * Sample Implementation of a structure for category channels, usable by direct end consumers.
950
+ */
951
+ declare class CategoryChannel<Omitted extends keyof APIGuildCategoryChannel | '' = ''> extends Channel<ChannelType.GuildCategory, Omitted> {
952
+ constructor(data: Partialize<APIGuildCategoryChannel, Omitted>);
953
+ }
954
+
955
+ interface DMChannel<Omitted extends keyof APIDMChannel | '' = ''> extends MixinTypes<Channel<ChannelType.DM>, [
956
+ DMChannelMixin<ChannelType.DM>,
957
+ TextChannelMixin<ChannelType.DM>,
958
+ ChannelPinMixin<ChannelType.DM>
959
+ ]> {
960
+ }
961
+ /**
962
+ * Sample Implementation of a structure for dm channels, usable by direct end consumers.
963
+ */
964
+ declare class DMChannel<Omitted extends keyof APIDMChannel | '' = ''> extends Channel<ChannelType.DM, Omitted> {
965
+ constructor(data: Partialize<APIDMChannel, Omitted>);
966
+ }
967
+
968
+ interface ForumChannel<Omitted extends keyof APIGuildForumChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildForum>, [
969
+ ChannelParentMixin<ChannelType.GuildForum>,
970
+ ChannelPermissionMixin<ChannelType.GuildForum>,
971
+ ChannelTopicMixin<ChannelType.GuildForum>,
972
+ ThreadOnlyChannelMixin<ChannelType.GuildForum>
973
+ ]> {
974
+ }
975
+ /**
976
+ * Sample Implementation of a structure for forum channels, usable by direct end consumers.
977
+ */
978
+ declare class ForumChannel<Omitted extends keyof APIGuildForumChannel | '' = ''> extends Channel<ChannelType.GuildForum, Omitted> {
979
+ constructor(data: Partialize<APIGuildForumChannel, Omitted>);
980
+ /**
981
+ * The default forum layout view used to display posts in this channel.
982
+ * Defaults to 0, which indicates a layout view has not been set by a channel admin.
983
+ */
984
+ get defaultForumLayout(): "default_forum_layout" extends infer T ? T extends "default_forum_layout" ? T extends Omitted ? unknown : APIGuildForumChannel[T] : never : never;
985
+ }
986
+
987
+ interface GroupDMChannel<Omitted extends keyof APIGroupDMChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GroupDM>, [
988
+ DMChannelMixin<ChannelType.GroupDM>,
989
+ TextChannelMixin<ChannelType.GroupDM>,
990
+ ChannelOwnerMixin<ChannelType.GroupDM>,
991
+ GroupDMMixin
992
+ ]> {
993
+ }
994
+ /**
995
+ * Sample Implementation of a structure for group dm channels, usable by direct end consumers.
996
+ */
997
+ declare class GroupDMChannel<Omitted extends keyof APIGroupDMChannel | '' = ''> extends Channel<ChannelType.GroupDM, Omitted> {
998
+ constructor(data: Partialize<APIGroupDMChannel, Omitted>);
999
+ }
1000
+
1001
+ interface MediaChannel<Omitted extends keyof APIGuildMediaChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildMedia>, [
1002
+ ChannelParentMixin<ChannelType.GuildMedia>,
1003
+ ChannelPermissionMixin<ChannelType.GuildMedia>,
1004
+ ChannelTopicMixin<ChannelType.GuildMedia>,
1005
+ ThreadOnlyChannelMixin<ChannelType.GuildMedia>
1006
+ ]> {
1007
+ }
1008
+ /**
1009
+ * Sample Implementation of a structure for media channels, usable by direct end consumers.
1010
+ */
1011
+ declare class MediaChannel<Omitted extends keyof APIGuildMediaChannel | '' = ''> extends Channel<ChannelType.GuildMedia, Omitted> {
1012
+ constructor(data: Partialize<APIGuildMediaChannel, Omitted>);
1013
+ }
1014
+
1015
+ interface PrivateThreadChannel<Omitted extends keyof APIPrivateThreadChannel | '' = ''> extends MixinTypes<Channel<ChannelType.PrivateThread>, [
1016
+ TextChannelMixin<ChannelType.PrivateThread>,
1017
+ ChannelOwnerMixin<ChannelType.PrivateThread>,
1018
+ ChannelParentMixin<ChannelType.PrivateThread>,
1019
+ ChannelPinMixin<ChannelType.PrivateThread>,
1020
+ ChannelSlowmodeMixin<ChannelType.PrivateThread>,
1021
+ ThreadChannelMixin<ChannelType.PrivateThread>
1022
+ ]> {
1023
+ }
1024
+ /**
1025
+ * Sample Implementation of a structure for private thread channels, usable by direct end consumers.
1026
+ */
1027
+ declare class PrivateThreadChannel<Omitted extends keyof APIPrivateThreadChannel | '' = ''> extends Channel<ChannelType.PrivateThread, Omitted> {
1028
+ constructor(data: Partialize<APIPrivateThreadChannel, Omitted>);
1029
+ }
1030
+
1031
+ interface PublicThreadChannel<Omitted extends keyof APIPublicThreadChannel | '' = ''> extends MixinTypes<Channel<ChannelType.PublicThread>, [
1032
+ TextChannelMixin<ChannelType.PublicThread>,
1033
+ ChannelOwnerMixin<ChannelType.PublicThread>,
1034
+ ChannelParentMixin<ChannelType.PublicThread>,
1035
+ ChannelPinMixin<ChannelType.PublicThread>,
1036
+ ChannelSlowmodeMixin<ChannelType.PublicThread>,
1037
+ ThreadChannelMixin<ChannelType.PublicThread>,
1038
+ AppliedTagsMixin
1039
+ ]> {
1040
+ }
1041
+ /**
1042
+ * Sample Implementation of a structure for public thread channels, usable by direct end consumers.
1043
+ */
1044
+ declare class PublicThreadChannel<Omitted extends keyof APIPublicThreadChannel | '' = ''> extends Channel<ChannelType.PublicThread, Omitted> {
1045
+ constructor(data: Partialize<APIPublicThreadChannel, Omitted>);
1046
+ }
1047
+
1048
+ interface StageChannel<Omitted extends keyof APIGuildStageVoiceChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildStageVoice>, [
1049
+ ChannelParentMixin<ChannelType.GuildStageVoice>,
1050
+ ChannelPermissionMixin<ChannelType.GuildStageVoice>,
1051
+ ChannelSlowmodeMixin<ChannelType.GuildStageVoice>,
1052
+ ChannelWebhookMixin<ChannelType.GuildStageVoice>,
1053
+ VoiceChannelMixin<ChannelType.GuildStageVoice>
1054
+ ]> {
1055
+ }
1056
+ declare class StageChannel<Omitted extends keyof APIGuildStageVoiceChannel | '' = ''> extends Channel<ChannelType.GuildStageVoice, Omitted> {
1057
+ constructor(data: Partialize<APIGuildStageVoiceChannel, Omitted>);
1058
+ }
1059
+
1060
+ interface TextChannel<Omitted extends keyof APITextChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildText>, [
1061
+ TextChannelMixin<ChannelType.GuildText>,
1062
+ ChannelParentMixin<ChannelType.GuildText>,
1063
+ ChannelPermissionMixin<ChannelType.GuildText>,
1064
+ ChannelPinMixin<ChannelType.GuildText>,
1065
+ ChannelSlowmodeMixin<ChannelType.GuildText>,
1066
+ ChannelTopicMixin<ChannelType.GuildText>
1067
+ ]> {
1068
+ }
1069
+ declare class TextChannel<Omitted extends keyof APITextChannel | '' = ''> extends Channel<ChannelType.GuildText, Omitted> {
1070
+ constructor(data: Partialize<APITextChannel, Omitted>);
1071
+ }
1072
+
1073
+ interface VoiceChannel<Omitted extends keyof APIGuildVoiceChannel | '' = ''> extends MixinTypes<Channel<ChannelType.GuildVoice>, [
1074
+ ChannelParentMixin<ChannelType.GuildVoice>,
1075
+ ChannelPermissionMixin<ChannelType.GuildVoice>,
1076
+ ChannelSlowmodeMixin<ChannelType.GuildVoice>,
1077
+ ChannelWebhookMixin<ChannelType.GuildVoice>,
1078
+ VoiceChannelMixin<ChannelType.GuildVoice>
1079
+ ]> {
1080
+ }
1081
+ declare class VoiceChannel<Omitted extends keyof APIGuildVoiceChannel | '' = ''> extends Channel<ChannelType.GuildVoice, Omitted> {
1082
+ constructor(data: Partialize<APIGuildVoiceChannel, Omitted>);
1083
+ }
1084
+
1085
+ interface APIActualInvite extends APIInvite, Partial<Omit<APIExtendedInvite, keyof APIInvite>> {
1086
+ }
1087
+ /**
1088
+ * Represents an invitation to a Discord channel
1089
+ *
1090
+ * @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
1091
+ */
1092
+ declare class Invite<Omitted extends keyof APIActualInvite | '' = 'created_at' | 'expires_at'> extends Structure<APIActualInvite, Omitted> {
1093
+ /**
1094
+ * The template used for removing data from the raw data stored for each Invite
1095
+ *
1096
+ * @remarks This template has defaults, if you want to remove additional data and keep the defaults,
1097
+ * use `Object.defineProperties`. To override the defaults, set this value directly.
1098
+ */
1099
+ static readonly DataTemplate: Partial<APIActualInvite>;
1100
+ /**
1101
+ * Optimized storage of {@link discord-api-types/v10#(APIActualInvite:interface).expires_at}
1102
+ *
1103
+ * @internal
1104
+ */
1105
+ protected [kExpiresTimestamp]: number | null;
1106
+ /**
1107
+ * Optimized storage of {@link discord-api-types/v10#(APIActualInvite:interface).created_at}
1108
+ *
1109
+ * @internal
1110
+ */
1111
+ protected [kCreatedTimestamp]: number | null;
1112
+ /**
1113
+ * @param data - The raw data received from the API for the invite
1114
+ */
1115
+ constructor(data: Partialize<APIActualInvite, Omitted>);
1116
+ /**
1117
+ * {@inheritDoc Structure.[kPatch]}
1118
+ *
1119
+ * @internal
1120
+ */
1121
+ [kPatch](data: Partial<APIActualInvite>): this;
1122
+ /**
1123
+ * {@inheritDoc Structure.optimizeData}
1124
+ *
1125
+ * @internal
1126
+ */
1127
+ protected optimizeData(data: Partial<APIActualInvite>): void;
1128
+ /**
1129
+ * The code for this invite
1130
+ */
1131
+ get code(): "code" extends infer T ? T extends "code" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never;
1132
+ /**
1133
+ * The target type (for voice channel invites)
1134
+ */
1135
+ get targetType(): ("target_type" extends infer T ? T extends "target_type" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
1136
+ /**
1137
+ * The type of this invite
1138
+ */
1139
+ get type(): "type" extends infer T ? T extends "type" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never;
1140
+ /**
1141
+ * The approximate number of online members of the guild this invite is for
1142
+ *
1143
+ * @remarks Only available when the invite was fetched from `GET /invites/<code>` with counts
1144
+ */
1145
+ get approximatePresenceCount(): ("approximate_presence_count" extends infer T ? T extends "approximate_presence_count" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
1146
+ /**
1147
+ * The approximate total number of members of the guild this invite is for
1148
+ *
1149
+ * @remarks Only available when the invite was fetched from `GET /invites/<code>` with counts
1150
+ */
1151
+ get approximateMemberCount(): ("approximate_member_count" extends infer T ? T extends "approximate_member_count" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
1152
+ /**
1153
+ * The timestamp this invite will expire at
1154
+ */
1155
+ get expiresTimestamp(): number | null;
1156
+ /**
1157
+ * The time the invite will expire at
1158
+ */
1159
+ get expiresAt(): Date | null;
1160
+ /**
1161
+ * The number of times this invite has been used
1162
+ */
1163
+ get uses(): ("uses" extends infer T ? T extends "uses" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
1164
+ /**
1165
+ * The maximum number of times this invite can be used
1166
+ */
1167
+ get maxUses(): ("max_uses" extends infer T ? T extends "max_uses" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
1168
+ /**
1169
+ * The maximum age of the invite, in seconds, 0 for non-expiring
1170
+ */
1171
+ get maxAge(): ("max_age" extends infer T ? T extends "max_age" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
1172
+ /**
1173
+ * Whether this invite only grants temporary membership
1174
+ */
1175
+ get temporary(): ("temporary" extends infer T ? T extends "temporary" ? T extends Omitted ? unknown : APIActualInvite[T] : never : never) | undefined;
1176
+ /**
1177
+ * The timestamp this invite was created at
1178
+ */
1179
+ get createdTimestamp(): number | null;
1180
+ /**
1181
+ * The time the invite was created at
1182
+ */
1183
+ get createdAt(): Date | null;
1184
+ /**
1185
+ * The URL to the invite
1186
+ */
1187
+ get url(): string | null;
1188
+ /**
1189
+ * When concatenated with a string, this automatically concatenates the invite's URL instead of the object.
1190
+ *
1191
+ * @returns The URL to the invite or an empty string if it doesn't have a code
1192
+ */
1193
+ toString(): string;
1194
+ /**
1195
+ * {@inheritDoc Structure.toJSON}
1196
+ */
1197
+ toJSON(): APIActualInvite;
1198
+ /**
1199
+ * Returns the primitive value of the specified object.
1200
+ */
1201
+ valueOf(): Object;
1202
+ }
1203
+
1204
+ /**
1205
+ * Represents metadata of an avatar decoration of a User.
1206
+ *
1207
+ * @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
1208
+ */
1209
+ declare class AvatarDecorationData<Omitted extends keyof APIAvatarDecorationData | '' = ''> extends Structure<APIAvatarDecorationData, Omitted> {
1210
+ /**
1211
+ * The template used for removing data from the raw data stored for each Connection
1212
+ */
1213
+ static readonly DataTemplate: Partial<APIAvatarDecorationData>;
1214
+ /**
1215
+ * @param data - The raw data received from the API for the connection
1216
+ */
1217
+ constructor(data: Partialize<APIAvatarDecorationData, Omitted>);
1218
+ /**
1219
+ * The id of the SKU this avatar decoration is part of.
1220
+ */
1221
+ get skuId(): "sku_id" extends infer T ? T extends "sku_id" ? T extends Omitted ? unknown : APIAvatarDecorationData[T] : never : never;
1222
+ /**
1223
+ * The asset of this avatar decoration.
1224
+ */
1225
+ get asset(): "asset" extends infer T ? T extends "asset" ? T extends Omitted ? unknown : APIAvatarDecorationData[T] : never : never;
1226
+ }
1227
+
1228
+ /**
1229
+ * Represents any user on Discord.
1230
+ *
1231
+ * @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
1232
+ * @remarks has a substructure `AvatarDecorationData`, which needs to be instantiated and stored by an extending class using it
1233
+ */
1234
+ declare class User<Omitted extends keyof APIUser | '' = ''> extends Structure<APIUser, Omitted> {
1235
+ /**
1236
+ * The template used for removing data from the raw data stored for each User
1237
+ */
1238
+ static readonly DataTemplate: Partial<APIUser>;
1239
+ /**
1240
+ * @param data - The raw data received from the API for the user
1241
+ */
1242
+ constructor(data: Partialize<APIUser, Omitted>);
1243
+ /**
1244
+ * {@inheritDoc Structure.[kPatch]}
1245
+ *
1246
+ * @internal
1247
+ */
1248
+ [kPatch](data: Partial<APIUser>): this;
1249
+ /**
1250
+ * The user's id
1251
+ */
1252
+ get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIUser[T] : never : never;
1253
+ /**
1254
+ * The username of the user
1255
+ */
1256
+ get username(): "username" extends infer T ? T extends "username" ? T extends Omitted ? unknown : APIUser[T] : never : never;
1257
+ /**
1258
+ * The user's 4 digit tag, if a bot
1259
+ */
1260
+ get discriminator(): "discriminator" extends infer T ? T extends "discriminator" ? T extends Omitted ? unknown : APIUser[T] : never : never;
1261
+ /**
1262
+ * The user's display name, the application name for bots
1263
+ */
1264
+ get globalName(): "global_name" extends infer T ? T extends "global_name" ? T extends Omitted ? unknown : APIUser[T] : never : never;
1265
+ /**
1266
+ * The name displayed in the client for this user when no nickname is set
1267
+ */
1268
+ get displayName(): ("username" extends infer T ? T extends "username" ? T extends Omitted ? unknown : APIUser[T] : never : never) | NonNullable<"global_name" extends infer T_1 ? T_1 extends "global_name" ? T_1 extends Omitted ? unknown : APIUser[T_1] : never : never>;
1269
+ /**
1270
+ * The user avatar's hash
1271
+ */
1272
+ get avatar(): "avatar" extends infer T ? T extends "avatar" ? T extends Omitted ? unknown : APIUser[T] : never : never;
1273
+ /**
1274
+ * Whether the user is a bot
1275
+ */
1276
+ get bot(): false | NonNullable<"bot" extends infer T ? T extends "bot" ? T extends Omitted ? unknown : APIUser[T] : never : never>;
1277
+ /**
1278
+ * Whether the user is an Official Discord System user
1279
+ */
1280
+ get system(): false | NonNullable<"system" extends infer T ? T extends "system" ? T extends Omitted ? unknown : APIUser[T] : never : never>;
1281
+ /**
1282
+ * Whether the user has mfa enabled
1283
+ *
1284
+ * @remarks This property is only set when the user was fetched with an OAuth2 token and the `identify` scope
1285
+ */
1286
+ get mfaEnabled(): ("mfa_enabled" extends infer T ? T extends "mfa_enabled" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
1287
+ /**
1288
+ * The user's banner hash
1289
+ *
1290
+ * @remarks This property is only set when the user was manually fetched
1291
+ */
1292
+ get banner(): ("banner" extends infer T ? T extends "banner" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
1293
+ /**
1294
+ * The base 10 accent color of the user's banner
1295
+ *
1296
+ * @remarks This property is only set when the user was manually fetched
1297
+ */
1298
+ get accentColor(): ("accent_color" extends infer T ? T extends "accent_color" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
1299
+ /**
1300
+ * The user's primary Discord language
1301
+ *
1302
+ * @remarks This property is only set when the user was fetched with an Oauth2 token and the `identify` scope
1303
+ */
1304
+ get locale(): ("locale" extends infer T ? T extends "locale" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
1305
+ /**
1306
+ * Whether the email on the user's account has been verified
1307
+ *
1308
+ * @remarks This property is only set when the user was fetched with an OAuth2 token and the `email` scope
1309
+ */
1310
+ get verified(): ("verified" extends infer T ? T extends "verified" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
1311
+ /**
1312
+ * The user's email
1313
+ *
1314
+ * @remarks This property is only set when the user was fetched with an OAuth2 token and the `email` scope
1315
+ */
1316
+ get email(): ("email" extends infer T ? T extends "email" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
1317
+ /**
1318
+ * The type of nitro subscription on the user's account
1319
+ *
1320
+ * @remarks This property is only set when the user was fetched with an OAuth2 token and the `identify` scope
1321
+ */
1322
+ get premiumType(): ("premium_type" extends infer T ? T extends "premium_type" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
1323
+ /**
1324
+ * The timestamp the user was created at
1325
+ */
1326
+ get createdTimestamp(): number | null;
1327
+ /**
1328
+ * The time the user was created at
1329
+ */
1330
+ get createdAt(): Date | null;
1331
+ /**
1332
+ * The hexadecimal version of the user accent color, with a leading hash
1333
+ *
1334
+ * @remarks This property is only set when the user was manually fetched
1335
+ */
1336
+ get hexAccentColor(): string | ("accent_color" extends infer T ? T extends "accent_color" ? T extends Omitted ? unknown : APIUser[T] : never : never) | undefined;
1337
+ }
1338
+
1339
+ /**
1340
+ * Represents a user's connection on Discord.
1341
+ *
1342
+ * @typeParam Omitted - Specify the properties that will not be stored in the raw data field as a union, implement via `DataTemplate`
1343
+ */
1344
+ declare class Connection<Omitted extends keyof APIConnection | '' = ''> extends Structure<APIConnection, Omitted> {
1345
+ /**
1346
+ * The template used for removing data from the raw data stored for each Connection
1347
+ */
1348
+ static readonly DataTemplate: Partial<APIConnection>;
1349
+ /**
1350
+ * @param data - The raw data received from the API for the connection
1351
+ */
1352
+ constructor(data: Partialize<APIConnection, Omitted>);
1353
+ /**
1354
+ * {@inheritDoc Structure.[kPatch]}
1355
+ *
1356
+ * @internal
1357
+ */
1358
+ [kPatch](data: Partial<APIConnection>): this;
1359
+ /**
1360
+ * The id of the connection account
1361
+ */
1362
+ get id(): "id" extends infer T ? T extends "id" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
1363
+ /**
1364
+ * The username of the connection account
1365
+ */
1366
+ get name(): "name" extends infer T ? T extends "name" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
1367
+ /**
1368
+ * The type of service this connection is for
1369
+ */
1370
+ get type(): "type" extends infer T ? T extends "type" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
1371
+ /**
1372
+ * Whether the connection is revoked
1373
+ */
1374
+ get revoked(): false | NonNullable<"revoked" extends infer T ? T extends "revoked" ? T extends Omitted ? unknown : APIConnection[T] : never : never>;
1375
+ /**
1376
+ * Whether the connection is verified
1377
+ */
1378
+ get verified(): "verified" extends infer T ? T extends "verified" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
1379
+ /**
1380
+ * Whether friend sync is enabled for this connection
1381
+ */
1382
+ get friendSync(): "friend_sync" extends infer T ? T extends "friend_sync" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
1383
+ /**
1384
+ * Whether activities related to this connection are shown in the users presence
1385
+ */
1386
+ get showActivity(): "show_activity" extends infer T ? T extends "show_activity" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
1387
+ /**
1388
+ * Whether this connection has an Oauth2 token for console voice transfer
1389
+ */
1390
+ get twoWayLink(): "two_way_link" extends infer T ? T extends "two_way_link" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
1391
+ /**
1392
+ * The visibility state for this connection
1393
+ */
1394
+ get visibility(): "visibility" extends infer T ? T extends "visibility" ? T extends Omitted ? unknown : APIConnection[T] : never : never;
1395
+ }
1396
+
1397
+ declare function extendTemplate<SuperTemplate extends Record<string, unknown>>(superTemplate: SuperTemplate, additions: Record<string, unknown>): Record<string, unknown> & SuperTemplate;
1398
+
1399
+ export { type APIActualInvite, AnnouncementChannel, AnnouncementThreadChannel, AppliedTagsMixin, AvatarDecorationData, BitField, type BitFieldResolvable, CategoryChannel, Channel, type ChannelDataType, ChannelFlagsBitField, ChannelOwnerMixin, ChannelParentMixin, ChannelPermissionMixin, ChannelPinMixin, ChannelSlowmodeMixin, ChannelTopicMixin, ChannelWebhookMixin, type CollapseUnion, Connection, DMChannel, DMChannelMixin, DataTemplatePropertyName, type EnumLike, ForumChannel, ForumTag, GroupDMChannel, GroupDMMixin, GuildChannelMixin, type If, Invite, MediaChannel, type MergePrototype, type MergePrototypes, Mixin, type MixinBase, type MixinTypes, type Mixinable, type NonAbstract, OptimizeDataPropertyName, type OptionalPropertyNames, type PartialChannel, type Partialize, PermissionOverwrite, PermissionsBitField, PrivateThreadChannel, PublicThreadChannel, type RecursiveReadonlyArray, type ReplaceOmittedWithUnknown, StageChannel, Structure, TextChannel, TextChannelMixin, ThreadChannelMixin, ThreadMetadata, ThreadOnlyChannelMixin, User, VoiceChannel, VoiceChannelMixin, extendTemplate };