mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
refactor: make Structure#deleted a getter to a WeakSet (#7074)
This commit is contained in:
31
typings/index.d.ts
vendored
31
typings/index.d.ts
vendored
@@ -490,7 +490,9 @@ export abstract class Channel extends Base {
|
||||
public constructor(client: Client, data?: RawChannelData, immediatePatch?: boolean);
|
||||
public readonly createdAt: Date;
|
||||
public readonly createdTimestamp: number;
|
||||
public deleted: boolean;
|
||||
public get deleted(): boolean;
|
||||
/** @deprecated Will be removed in v14 */
|
||||
public set deleted(value: boolean);
|
||||
public id: Snowflake;
|
||||
public readonly partial: false;
|
||||
public type: keyof typeof ChannelTypes;
|
||||
@@ -825,7 +827,9 @@ export class Emoji extends Base {
|
||||
public animated: boolean | null;
|
||||
public readonly createdAt: Date | null;
|
||||
public readonly createdTimestamp: number | null;
|
||||
public deleted: boolean;
|
||||
public get deleted(): boolean;
|
||||
/** @deprecated Will be removed in v14 */
|
||||
public set deleted(value: boolean);
|
||||
public id: Snowflake | null;
|
||||
public name: string | null;
|
||||
public readonly identifier: string;
|
||||
@@ -850,7 +854,9 @@ export class Guild extends AnonymousGuild {
|
||||
public channels: GuildChannelManager;
|
||||
public commands: GuildApplicationCommandManager;
|
||||
public defaultMessageNotifications: DefaultMessageNotificationLevel | number;
|
||||
public deleted: boolean;
|
||||
public get deleted(): boolean;
|
||||
/** @deprecated Will be removed in v14 */
|
||||
public set deleted(value: boolean);
|
||||
public discoverySplash: string | null;
|
||||
public emojis: GuildEmojiManager;
|
||||
public explicitContentFilter: ExplicitContentFilterLevel;
|
||||
@@ -1054,7 +1060,9 @@ export class GuildMember extends PartialTextBasedChannel(Base) {
|
||||
private constructor(client: Client, data: RawGuildMemberData, guild: Guild);
|
||||
public avatar: string | null;
|
||||
public readonly bannable: boolean;
|
||||
public deleted: boolean;
|
||||
public get deleted(): boolean;
|
||||
/** @deprecated Will be removed in v14 */
|
||||
public set deleted(value: boolean);
|
||||
public readonly displayColor: number;
|
||||
public readonly displayHexColor: HexColorString;
|
||||
public readonly displayName: string;
|
||||
@@ -1392,7 +1400,9 @@ export class Message<Cached extends boolean = boolean> extends Base {
|
||||
public createdTimestamp: number;
|
||||
public readonly crosspostable: boolean;
|
||||
public readonly deletable: boolean;
|
||||
public deleted: boolean;
|
||||
public get deleted(): boolean;
|
||||
/** @deprecated Will be removed in v14 */
|
||||
public set deleted(value: boolean);
|
||||
public readonly editable: boolean;
|
||||
public readonly editedAt: Date | null;
|
||||
public editedTimestamp: number | null;
|
||||
@@ -1821,7 +1831,9 @@ export class Role extends Base {
|
||||
public color: number;
|
||||
public readonly createdAt: Date;
|
||||
public readonly createdTimestamp: number;
|
||||
public deleted: boolean;
|
||||
public get deleted(): boolean;
|
||||
/** @deprecated Will be removed in v14 */
|
||||
public set deleted(value: boolean);
|
||||
public readonly editable: boolean;
|
||||
public guild: Guild;
|
||||
public readonly hexColor: HexColorString;
|
||||
@@ -1999,7 +2011,9 @@ export class StageChannel extends BaseGuildVoiceChannel {
|
||||
export class StageInstance extends Base {
|
||||
private constructor(client: Client, data: RawStageInstanceData, channel: StageChannel);
|
||||
public id: Snowflake;
|
||||
public deleted: boolean;
|
||||
public get deleted(): boolean;
|
||||
/** @deprecated Will be removed in v14 */
|
||||
public set deleted(value: boolean);
|
||||
public guildId: Snowflake;
|
||||
public channelId: Snowflake;
|
||||
public topic: string;
|
||||
@@ -2016,6 +2030,9 @@ export class StageInstance extends Base {
|
||||
|
||||
export class Sticker extends Base {
|
||||
private constructor(client: Client, data: RawStickerData);
|
||||
public get deleted(): boolean;
|
||||
/** @deprecated Will be removed in v14 */
|
||||
public set deleted(value: boolean);
|
||||
public readonly createdTimestamp: number;
|
||||
public readonly createdAt: Date;
|
||||
public available: boolean | null;
|
||||
|
||||
@@ -83,6 +83,8 @@ import {
|
||||
GuildAuditLogsEntry,
|
||||
GuildAuditLogs,
|
||||
StageInstance,
|
||||
Sticker,
|
||||
Emoji,
|
||||
} from '.';
|
||||
import type { ApplicationCommandOptionTypes } from './enums';
|
||||
import { expectAssignable, expectDeprecated, expectNotAssignable, expectNotType, expectType } from 'tsd';
|
||||
@@ -749,6 +751,7 @@ declare const newsChannel: NewsChannel;
|
||||
declare const textChannel: TextChannel;
|
||||
declare const storeChannel: StoreChannel;
|
||||
declare const categoryChannel: CategoryChannel;
|
||||
declare const voiceChannel: VoiceChannel;
|
||||
declare const guild: Guild;
|
||||
declare const user: User;
|
||||
declare const guildMember: GuildMember;
|
||||
@@ -896,6 +899,25 @@ client.on('messageReactionAdd', async reaction => {
|
||||
expectType<string>(reaction.message.content);
|
||||
});
|
||||
|
||||
// Test .deleted deprecations
|
||||
declare const emoji: Emoji;
|
||||
declare const message: Message;
|
||||
declare const role: Role;
|
||||
declare const stageInstance: StageInstance;
|
||||
declare const sticker: Sticker;
|
||||
expectDeprecated((dmChannel.deleted = true));
|
||||
expectDeprecated((textChannel.deleted = true));
|
||||
expectDeprecated((voiceChannel.deleted = true));
|
||||
expectDeprecated((newsChannel.deleted = true));
|
||||
expectDeprecated((threadChannel.deleted = true));
|
||||
expectDeprecated((emoji.deleted = true));
|
||||
expectDeprecated((guildMember.deleted = true));
|
||||
expectDeprecated((guild.deleted = true));
|
||||
expectDeprecated((message.deleted = true));
|
||||
expectDeprecated((role.deleted = true));
|
||||
expectDeprecated((stageInstance.deleted = true));
|
||||
expectDeprecated((sticker.deleted = true));
|
||||
|
||||
// Test interactions
|
||||
declare const interaction: Interaction;
|
||||
declare const booleanValue: boolean;
|
||||
|
||||
Reference in New Issue
Block a user