feat(Shard): add eval context (#7011)

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
This commit is contained in:
dai
2021-11-23 10:26:46 +01:00
committed by GitHub
parent c1f2fe29ef
commit 77aff08345
2 changed files with 4 additions and 2 deletions

1
typings/index.d.ts vendored
View File

@@ -1867,6 +1867,7 @@ export class Shard extends EventEmitter {
public worker: Worker | null;
public eval(script: string): Promise<unknown>;
public eval<T>(fn: (client: Client) => T): Promise<T>;
public eval<T, P>(fn: (client: Client, context: Serialized<P>) => T, context: P): Promise<T>;
public fetchClientValue(prop: string): Promise<unknown>;
public kill(): void;
public respawn(options?: { delay?: number; timeout?: number }): Promise<ChildProcess>;