refactor: code cleanups
[poolifier.git] / examples / typescript / http-server-pool / fastify-hybrid / @types / fastify / index.d.ts
1 import type { TransferListItem } from 'node:worker_threads'
2
3 import type * as fastify from 'fastify'
4 import type { DynamicThreadPool } from 'poolifier'
5
6 import type { ThreadWorkerData, ThreadWorkerResponse } from '../../src/types.ts'
7
8 declare module 'fastify' {
9 export interface FastifyInstance extends fastify.FastifyInstance {
10 pool: DynamicThreadPool<ThreadWorkerData, ThreadWorkerResponse>
11 execute: (
12 data?: ThreadWorkerData,
13 name?: string,
14 transferList?: readonly TransferListItem[]
15 ) => Promise<ThreadWorkerResponse>
16 }
17 }