Skip to content

Commit

Permalink
🏷️ feat(framework): fanci(not really) superclass type
Browse files Browse the repository at this point in the history
  • Loading branch information
Helloyunho committed May 18, 2024
1 parent 4f67351 commit 1b7bde4
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 20 deletions.
19 changes: 15 additions & 4 deletions framework/src/structures/channels/guildAnnouncementChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof GuildTextBasedChannel, keyof typeof GuildTextBasedChannel>
& Pick<
typeof GuildThreadAvailableChannel,
keyof typeof GuildThreadAvailableChannel
> = Mixin(
GuildTextBasedChannel,
GuildThreadAvailableChannel,
);

export class GuildAnnouncementChannel extends GuildAnnouncementChannelSuper {
payload: GuildAnnouncementChannelPayload;
constructor(
client: Client,
Expand Down
20 changes: 16 additions & 4 deletions framework/src/structures/channels/guildForumChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof GuildTextBasedChannel, keyof typeof GuildTextBasedChannel> =
Mixin(
GuildThreadAvailableChannel,
GuildTextBasedChannel,
);

export class GuildForumChannel extends GuildForumChannelSuper {
payload: GuildForumChannelPayload;
constructor(client: Client, payload: GuildForumChannelPayload) {
super(client, payload);
Expand Down
16 changes: 12 additions & 4 deletions framework/src/structures/channels/guildTextBasedChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof TextChannel, keyof typeof TextChannel>
& Pick<typeof GuildChannel, keyof typeof GuildChannel> = Mixin(
TextChannel,
GuildChannel,
);

export class GuildTextBasedChannel extends GuildTextBasedChannelSuper {
payload: GuildTextBasedChannelPayload;
constructor(client: Client, payload: GuildTextBasedChannelPayload) {
super(client, payload);
Expand Down
19 changes: 15 additions & 4 deletions framework/src/structures/channels/guildTextChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof GuildTextBasedChannel, keyof typeof GuildTextBasedChannel>
& Pick<
typeof GuildThreadAvailableChannel,
keyof typeof GuildThreadAvailableChannel
> = Mixin(
GuildTextBasedChannel,
GuildThreadAvailableChannel,
);

export class GuildTextChannel extends GuildTextChannelSuper {
payload: GuildTextChannelPayload;
constructor(client: Client, payload: GuildTextChannelPayload) {
super(client, payload);
Expand Down
17 changes: 13 additions & 4 deletions framework/src/structures/channels/guildVoiceChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof GuildTextBasedChannel, keyof typeof GuildTextBasedChannel>
& Pick<typeof GuildVoiceBasedChannel, keyof typeof GuildVoiceBasedChannel> =
Mixin(
GuildTextBasedChannel,
GuildVoiceBasedChannel,
);

export class GuildVoiceChannel extends GuildGuildVoiceChannelSuper {
payload: GuildVoiceChannelPayload;
constructor(client: Client, payload: GuildVoiceChannelPayload) {
super(client, payload);
Expand Down

0 comments on commit 1b7bde4

Please sign in to comment.