mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
feat: backport (#7776)
This commit is contained in:
5
typings/index.d.ts
vendored
5
typings/index.d.ts
vendored
@@ -4603,7 +4603,10 @@ export interface FetchBanOptions extends BaseFetchOptions {
|
||||
}
|
||||
|
||||
export interface FetchBansOptions {
|
||||
cache: boolean;
|
||||
limit?: number;
|
||||
before?: Snowflake;
|
||||
after?: Snowflake;
|
||||
cache?: boolean;
|
||||
}
|
||||
|
||||
export interface FetchChannelOptions extends BaseFetchOptions {
|
||||
|
||||
@@ -94,6 +94,8 @@ import {
|
||||
MessageSelectMenu,
|
||||
PartialDMChannel,
|
||||
InteractionResponseFields,
|
||||
GuildBan,
|
||||
GuildBanManager,
|
||||
} from '.';
|
||||
import type { ApplicationCommandOptionTypes } from './enums';
|
||||
import { expectAssignable, expectDeprecated, expectNotAssignable, expectNotType, expectType } from 'tsd';
|
||||
@@ -891,6 +893,20 @@ expectType<Promise<Collection<Snowflake, GuildEmoji>>>(guildEmojiManager.fetch()
|
||||
expectType<Promise<Collection<Snowflake, GuildEmoji>>>(guildEmojiManager.fetch(undefined, {}));
|
||||
expectType<Promise<GuildEmoji>>(guildEmojiManager.fetch('0'));
|
||||
|
||||
declare const guildBanManager: GuildBanManager;
|
||||
{
|
||||
expectType<Promise<GuildBan>>(guildBanManager.fetch('1234567890'));
|
||||
expectType<Promise<GuildBan>>(guildBanManager.fetch({ user: '1234567890' }));
|
||||
expectType<Promise<GuildBan>>(guildBanManager.fetch({ user: '1234567890', cache: true, force: false }));
|
||||
expectType<Promise<Collection<Snowflake, GuildBan>>>(guildBanManager.fetch());
|
||||
expectType<Promise<Collection<Snowflake, GuildBan>>>(guildBanManager.fetch({}));
|
||||
expectType<Promise<Collection<Snowflake, GuildBan>>>(guildBanManager.fetch({ limit: 100, before: '1234567890' }));
|
||||
// @ts-expect-error
|
||||
guildBanManager.fetch({ cache: true, force: false });
|
||||
// @ts-expect-error
|
||||
guildBanManager.fetch({ user: '1234567890', after: '1234567890', cache: true, force: false });
|
||||
}
|
||||
|
||||
declare const typing: Typing;
|
||||
expectType<PartialUser>(typing.user);
|
||||
if (typing.user.partial) expectType<null>(typing.user.username);
|
||||
|
||||
Reference in New Issue
Block a user