fix: refine type definition for transferList
[poolifier.git] / src / pools / abstract-pool.ts
index 5eeb57911903587c0760dac8fee11e30407cb86a..01e621c297a1bc0cb818b807d1e13fe33344952e 100644 (file)
@@ -893,7 +893,7 @@ export abstract class AbstractPool<
   public async execute (
     data?: Data,
     name?: string,
-    transferList?: TransferListItem[]
+    transferList?: readonly TransferListItem[]
   ): Promise<Response> {
     return await new Promise<Response>((resolve, reject) => {
       if (!this.started) {
@@ -1070,7 +1070,9 @@ export abstract class AbstractPool<
   }
 
   /**
-   * Should return whether the worker is the main worker or not.
+   * Returns whether the worker is the main worker or not.
+   *
+   * @returns `true` if the worker is the main worker, `false` otherwise.
    */
   protected abstract isMain (): boolean
 
@@ -1226,7 +1228,7 @@ export abstract class AbstractPool<
   protected abstract sendToWorker (
     workerNodeKey: number,
     message: MessageValue<Data>,
-    transferList?: TransferListItem[]
+    transferList?: readonly TransferListItem[]
   ): void
 
   /**