Skip to content

Commit

Permalink
fix: correct types
Browse files Browse the repository at this point in the history
  • Loading branch information
KagChi authored Oct 6, 2024
1 parent 203de47 commit 8d3aac7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/clusterManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ export class ClusterManager<
* Creates an instance of ClusterManager.
* @constructor
* @param {string} file - Path to the file that will be spawned.
* @param {ClusterManagerOptions<ClusteringMode>} options - Options for the ClusterManager.
* @param {ClusterManagerCreateOptions<ClusteringMode>} options - Options for the ClusterManager.
*/
constructor(public file: string, options: ClusterManagerOptions<ClusteringMode>) {
constructor(public file: string, options: ClusterManagerCreateOptions<ClusteringMode>) {
super();

if (!file) throw new Error('CLIENT_INVALID_OPTION | No File specified.');
Expand All @@ -122,7 +122,7 @@ export class ClusterManager<
maxMissedHeartbeats: 3,
}),
mode: options.mode || 'worker',
shardList: [], clusterList: [],
clusterList: [],
spawnOptions: {
timeout: options.spawnOptions?.timeout ?? -1,
delay: options.spawnOptions?.delay ?? 8000,
Expand Down
5 changes: 5 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ export type Serialized<T> = T extends symbol | bigint | UnknownFunction ? never
* @template {ClusteringMode} T - The type of the clustering mode.
*/
export interface ClusterManagerCreateOptions<T extends ClusteringMode> {
/**
* An Array of Internal Shards Ids, which should get spawned.
* @type {number[]}
*/
shardList: number[];
/**
* What mode to use for clustering.
* @type {?T}
Expand Down

0 comments on commit 8d3aac7

Please sign in to comment.