From 14d9a9901bc03873560d729e7789ac043891c2f0 Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Fri, 29 Oct 2021 00:47:18 +0200 Subject: [PATCH] types(Shard): eval returns a promise resolving with T instead of T[] (#6901) --- typings/index.d.ts | 2 +- typings/tests.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/typings/index.d.ts b/typings/index.d.ts index 71b78d27f..a450f298d 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1746,7 +1746,7 @@ export class Shard extends EventEmitter { public ready: boolean; public worker: Worker | null; public eval(script: string): Promise; - public eval(fn: (client: Client) => T): Promise; + public eval(fn: (client: Client) => T): Promise; public fetchClientValue(prop: string): Promise; public kill(): void; public respawn(options?: { delay?: number; timeout?: number }): Promise; diff --git a/typings/tests.ts b/typings/tests.ts index 40de09e17..f9c6bd9bc 100644 --- a/typings/tests.ts +++ b/typings/tests.ts @@ -76,6 +76,7 @@ import { Typing, User, VoiceChannel, + Shard, } from '.'; import type { ApplicationCommandOptionTypes } from './enums'; @@ -1050,3 +1051,7 @@ client.on('interactionCreate', async interaction => { assertType(interaction.options.getSubcommandGroup(false)); } }); + +declare const shard: Shard; + +assertType>(shard.eval(c => c.readyTimestamp));