From 1b7bde486ab85c905bba62b8c861ae5624f9ec33 Mon Sep 17 00:00:00 2001 From: Helloyunho Date: Sun, 19 May 2024 01:53:44 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20feat(framework):=20fanc?= =?UTF-8?q?i(not=20really)=20superclass=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../channels/guildAnnouncementChannel.ts | 19 ++++++++++++++---- .../structures/channels/guildForumChannel.ts | 20 +++++++++++++++---- .../channels/guildTextBasedChannel.ts | 16 +++++++++++---- .../structures/channels/guildTextChannel.ts | 19 ++++++++++++++---- .../structures/channels/guildVoiceChannel.ts | 17 ++++++++++++---- 5 files changed, 71 insertions(+), 20 deletions(-) diff --git a/framework/src/structures/channels/guildAnnouncementChannel.ts b/framework/src/structures/channels/guildAnnouncementChannel.ts index a4294534..cf889620 100644 --- a/framework/src/structures/channels/guildAnnouncementChannel.ts +++ b/framework/src/structures/channels/guildAnnouncementChannel.ts @@ -4,10 +4,21 @@ import type { Client } from "../../client/mod.ts"; import { GuildTextBasedChannel } from "./guildTextBasedChannel.ts"; import { GuildThreadAvailableChannel } from "./guildThreadAvailableChannel.ts"; -export class GuildAnnouncementChannel extends Mixin( - GuildTextBasedChannel, - GuildThreadAvailableChannel, -) { +const GuildAnnouncementChannelSuper: + & (abstract new ( + client: Client, + payload: GuildAnnouncementChannelPayload, + ) => GuildTextBasedChannel & GuildThreadAvailableChannel) + & Pick + & Pick< + typeof GuildThreadAvailableChannel, + keyof typeof GuildThreadAvailableChannel + > = Mixin( + GuildTextBasedChannel, + GuildThreadAvailableChannel, + ); + +export class GuildAnnouncementChannel extends GuildAnnouncementChannelSuper { payload: GuildAnnouncementChannelPayload; constructor( client: Client, diff --git a/framework/src/structures/channels/guildForumChannel.ts b/framework/src/structures/channels/guildForumChannel.ts index c3f836c1..374b2179 100644 --- a/framework/src/structures/channels/guildForumChannel.ts +++ b/framework/src/structures/channels/guildForumChannel.ts @@ -6,10 +6,22 @@ import { Emoji } from "../emojis/mod.ts"; import { GuildTextBasedChannel } from "./guildTextBasedChannel.ts"; import { GuildThreadAvailableChannel } from "./guildThreadAvailableChannel.ts"; -export class GuildForumChannel extends Mixin( - GuildThreadAvailableChannel, - GuildTextBasedChannel, -) { +const GuildForumChannelSuper: + & (abstract new ( + client: Client, + payload: GuildForumChannelPayload, + ) => GuildThreadAvailableChannel & GuildTextBasedChannel) + & Pick< + typeof GuildThreadAvailableChannel, + keyof typeof GuildThreadAvailableChannel + > + & Pick = + Mixin( + GuildThreadAvailableChannel, + GuildTextBasedChannel, + ); + +export class GuildForumChannel extends GuildForumChannelSuper { payload: GuildForumChannelPayload; constructor(client: Client, payload: GuildForumChannelPayload) { super(client, payload); diff --git a/framework/src/structures/channels/guildTextBasedChannel.ts b/framework/src/structures/channels/guildTextBasedChannel.ts index a4520ab8..5ebad9f7 100644 --- a/framework/src/structures/channels/guildTextBasedChannel.ts +++ b/framework/src/structures/channels/guildTextBasedChannel.ts @@ -4,10 +4,18 @@ import { GuildChannel } from "./guildChannel.ts"; import type { GuildTextBasedChannelPayload } from "../../../../types/mod.ts"; import type { Client } from "../../client/mod.ts"; -export class GuildTextBasedChannel extends Mixin( - GuildChannel, - TextChannel, -) { +const GuildTextBasedChannelSuper: + & (abstract new ( + client: Client, + payload: GuildTextBasedChannelPayload, + ) => TextChannel & GuildChannel) + & Pick + & Pick = Mixin( + TextChannel, + GuildChannel, + ); + +export class GuildTextBasedChannel extends GuildTextBasedChannelSuper { payload: GuildTextBasedChannelPayload; constructor(client: Client, payload: GuildTextBasedChannelPayload) { super(client, payload); diff --git a/framework/src/structures/channels/guildTextChannel.ts b/framework/src/structures/channels/guildTextChannel.ts index e1c16969..07e063e2 100644 --- a/framework/src/structures/channels/guildTextChannel.ts +++ b/framework/src/structures/channels/guildTextChannel.ts @@ -4,10 +4,21 @@ import type { Client } from "../../client/mod.ts"; import { GuildTextBasedChannel } from "./guildTextBasedChannel.ts"; import { GuildThreadAvailableChannel } from "./guildThreadAvailableChannel.ts"; -export class GuildTextChannel extends Mixin( - GuildTextBasedChannel, - GuildThreadAvailableChannel, -) { +const GuildTextChannelSuper: + & (abstract new ( + client: Client, + payload: GuildTextChannelPayload, + ) => GuildTextBasedChannel & GuildThreadAvailableChannel) + & Pick + & Pick< + typeof GuildThreadAvailableChannel, + keyof typeof GuildThreadAvailableChannel + > = Mixin( + GuildTextBasedChannel, + GuildThreadAvailableChannel, + ); + +export class GuildTextChannel extends GuildTextChannelSuper { payload: GuildTextChannelPayload; constructor(client: Client, payload: GuildTextChannelPayload) { super(client, payload); diff --git a/framework/src/structures/channels/guildVoiceChannel.ts b/framework/src/structures/channels/guildVoiceChannel.ts index e50854d2..21fe12d6 100644 --- a/framework/src/structures/channels/guildVoiceChannel.ts +++ b/framework/src/structures/channels/guildVoiceChannel.ts @@ -4,10 +4,19 @@ import type { Client } from "../../client/mod.ts"; import { GuildTextBasedChannel } from "./guildTextBasedChannel.ts"; import { GuildVoiceBasedChannel } from "./guildVoiceBasedChannel.ts"; -export class GuildVoiceChannel extends Mixin( - GuildTextBasedChannel, - GuildVoiceBasedChannel, -) { +const GuildGuildVoiceChannelSuper: + & (abstract new ( + client: Client, + payload: GuildVoiceChannelPayload, + ) => GuildTextBasedChannel & GuildVoiceBasedChannel) + & Pick + & Pick = + Mixin( + GuildTextBasedChannel, + GuildVoiceBasedChannel, + ); + +export class GuildVoiceChannel extends GuildGuildVoiceChannelSuper { payload: GuildVoiceChannelPayload; constructor(client: Client, payload: GuildVoiceChannelPayload) { super(client, payload);