types: Narrow channel type in thread managers (#8640)

types: narrow channel type in thread managers

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Jiralite
2022-09-19 21:00:59 +01:00
committed by GitHub
parent a7f816eeb7
commit 14bbc9150a
4 changed files with 17 additions and 3 deletions

View File

@@ -10,6 +10,12 @@ const MessagePayload = require('../structures/MessagePayload');
* @extends {ThreadManager}
*/
class GuildForumThreadManager extends ThreadManager {
/**
* The channel this Manager belongs to
* @name GuildForumThreadManager#channel
* @type {ForumChannel}
*/
/**
* @typedef {BaseMessageOptions} GuildForumThreadCreateOptions
* @property {stickers} [stickers] The stickers to send with the message

View File

@@ -9,6 +9,12 @@ const { ErrorCodes, TypeError } = require('../errors');
* @extends {ThreadManager}
*/
class GuildTextThreadManager extends ThreadManager {
/**
* The channel this Manager belongs to
* @name GuildTextThreadManager#channel
* @type {TextChannel|NewsChannel}
*/
/**
* Options for creating a thread. <warn>Only one of `startMessage` or `type` can be defined.</warn>
* @typedef {StartThreadOptions} ThreadCreateOptions

View File

@@ -17,7 +17,7 @@ class ThreadManager extends CachedManager {
/**
* The channel this Manager belongs to
* @type {NewsChannel|TextChannel|ForumChannel}
* @type {TextChannel|NewsChannel|ForumChannel}
*/
this.channel = channel;
}

View File

@@ -3674,8 +3674,8 @@ export class StageInstanceManager extends CachedManager<Snowflake, StageInstance
}
export class ThreadManager extends CachedManager<Snowflake, ThreadChannel, ThreadChannelResolvable> {
protected constructor(channel: TextChannel | NewsChannel, iterable?: Iterable<RawThreadChannelData>);
public channel: TextChannel | NewsChannel;
protected constructor(channel: TextChannel | NewsChannel | ForumChannel, iterable?: Iterable<RawThreadChannelData>);
public channel: TextChannel | NewsChannel | ForumChannel;
public fetch(options: ThreadChannelResolvable, cacheOptions?: BaseFetchOptions): Promise<AnyThreadChannel | null>;
public fetch(options?: FetchThreadsOptions, cacheOptions?: { cache?: boolean }): Promise<FetchedThreads>;
public fetchArchived(options?: FetchArchivedThreadOptions, cache?: boolean): Promise<FetchedThreads>;
@@ -3683,10 +3683,12 @@ export class ThreadManager extends CachedManager<Snowflake, ThreadChannel, Threa
}
export class GuildTextThreadManager<AllowedThreadType> extends ThreadManager {
public channel: TextChannel | NewsChannel;
public create(options: GuildTextThreadCreateOptions<AllowedThreadType>): Promise<ThreadChannel>;
}
export class GuildForumThreadManager extends ThreadManager {
public channel: ForumChannel;
public create(options: GuildForumThreadCreateOptions): Promise<ThreadChannel>;
}