fix: fix fastify worker_threads type definition
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 13 Aug 2023 12:58:22 +0000 (14:58 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 13 Aug 2023 12:58:22 +0000 (14:58 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
examples/typescript/http-server-pool/fastify-worker_threads/@types/fastify/index.d.ts

index 0e43ad26fe6c42ffa4481b55947f64a574467882..e2ec4062820d299647132f7ac0306127e0ebe57e 100644 (file)
@@ -1,3 +1,4 @@
+import type { TransferListItem } from 'node:worker_threads'
 import type * as fastify from 'fastify'
 import { type DynamicThreadPool } from 'poolifier'
 import { type WorkerData, type WorkerResponse } from '../../src/types.ts'
@@ -5,6 +6,10 @@ import { type WorkerData, type WorkerResponse } from '../../src/types.ts'
 declare module 'fastify' {
   export interface FastifyInstance extends fastify.FastifyInstance {
     pool: DynamicThreadPool<WorkerData, WorkerResponse>
-    execute: (data?: WorkerData, name?: string) => Promise<WorkerResponse>
+    execute: (
+      data?: WorkerData,
+      name?: string,
+      transferList?: TransferListItem[]
+    ) => Promise<WorkerResponse>
   }
 }