Skip to content

Commit

Permalink
Update Typings
Browse files Browse the repository at this point in the history
  • Loading branch information
meister03 committed Sep 14, 2022
1 parent 6287100 commit 89ec4a2
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ One first package which combines sharding manager & internal sharding to save a

In other words: "Mixing both: if you need `x` shards for `n` process!"

**[NEW: TypeScript Rewrite](#Use-with-other-libraries)**
**[NEW: TypeScript Rewrite | Upgrade Guide](https://gist.github.com/meister03/882ba6f6d805384f27336dd5ba389a54)**
**[NEW: Clustering Support for all JS Libraries](#Use-with-other-libraries)**

If you are interested in auto-scaling & cross-hosting on other machines, check out this package `npmjs.com/discord-cross-hosting`
Expand Down
5 changes: 2 additions & 3 deletions dist/Core/Cluster.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { ClusterManager } from "./ClusterManager";
import EventEmitter from 'events';
import { ClusterEvents, ClusterKillOptions } from '../types/shared';
Expand Down Expand Up @@ -38,9 +37,9 @@ export declare class Cluster extends EventEmitter {
messageHandler: any;
ready: boolean;
constructor(manager: ClusterManager, id: number, shardList: number[], totalShards: number);
spawn(spawnTimeout?: number): Promise<import("child_process").ChildProcess | import("worker_threads").Worker | null>;
spawn(spawnTimeout?: number): Promise<import("worker_threads").Worker | import("child_process").ChildProcess | null>;
kill(options: ClusterKillOptions): void;
respawn({ delay, timeout }?: import("../types/shared").ClusterManagerSpawnOptions): Promise<import("child_process").ChildProcess | import("worker_threads").Worker | null>;
respawn({ delay, timeout }?: import("../types/shared").ClusterManagerSpawnOptions): Promise<import("worker_threads").Worker | import("child_process").ChildProcess | null>;
send(message: RawMessage): Promise<unknown> | undefined;
request(message: RawMessage): Promise<unknown>;
eval(script: string, context: any, timeout: number): Promise<unknown>;
Expand Down
2 changes: 1 addition & 1 deletion dist/Core/Cluster.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions dist/Core/ClusterClient.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
/// <reference types="node" />
/// <reference types="node" />
import { RawMessage } from '../Structures/IPCMessage';
import { Awaitable, ClusterClientEvents, evalOptions, Serialized } from '../types/shared';
import { Awaitable, ClusterClientEvents, DjsClient, evalOptions, Serialized } from '../types/shared';
import { ClusterManager as Manager } from '../Core/ClusterManager';
import { WorkerClient } from '../Structures/Worker';
import { ChildClient } from '../Structures/Child';
import { PromiseHandler } from '../Structures/PromiseHandler';
import EventEmitter from 'events';
import { Serializable } from 'child_process';
export declare class ClusterClient extends EventEmitter {
client: any;
client: DjsClient;
mode: 'process' | 'worker';
queue: {
mode: 'auto' | string | undefined;
Expand All @@ -19,9 +18,9 @@ export declare class ClusterClient extends EventEmitter {
process: ChildClient | WorkerClient | null;
messageHandler: any;
promise: PromiseHandler;
constructor(client: any);
constructor(client: DjsClient);
get id(): number;
get ids(): any;
get ids(): number[] | import("discord.js").Collection<number, import("discord.js").WebSocketShard>;
get count(): number;
get info(): import("../Structures/Data").ClusterClientData;
send(message: Serializable): Promise<void> | undefined;
Expand All @@ -43,7 +42,7 @@ export declare class ClusterClient extends EventEmitter {
timeout?: number | undefined;
}): Promise<void> | undefined;
private _handleMessage;
_eval(script: string): Promise<any>;
_eval(script: string): Promise<unknown>;
_respond(type: string, message: Serializable): void;
triggerReady(): boolean;
triggerClusterReady(): boolean;
Expand Down
2 changes: 1 addition & 1 deletion dist/Core/ClusterClient.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions dist/Core/ClusterManager.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference types="node" />
import EventEmitter from 'events';
import { Queue } from '../Structures/Queue';
import { Cluster } from './Cluster';
Expand Down Expand Up @@ -35,8 +34,8 @@ export declare class ClusterManager extends EventEmitter {
spawn({ amount, delay, timeout }?: ClusterManagerSpawnOptions): Promise<unknown>;
broadcast(message: BaseMessage): Promise<unknown[]>;
createCluster(id: number, shardsToSpawn: number[], totalShards: number, recluster?: boolean): Cluster;
broadcastEval(script: string, evalOptions?: evalOptions): Promise<unknown[]> | undefined;
fetchClientValues(prop: string, cluster?: number): Promise<unknown[]> | undefined;
broadcastEval(script: string, evalOptions?: evalOptions): Promise<any[]> | undefined;
fetchClientValues(prop: string, cluster?: number): Promise<any[]> | undefined;
private _performOnClusters;
respawnAll({ clusterDelay, respawnDelay, timeout }?: {
clusterDelay?: number | undefined;
Expand Down
Loading

0 comments on commit 89ec4a2

Please sign in to comment.