e1a64b1559ca4e9d8dc91ba424f08d0f08299863
[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 {
7 type ThreadWorkerData,
8 type ThreadWorkerResponse
9 } from '../../src/types.ts'
10
11 declare module 'fastify' {
12 export interface FastifyInstance extends fastify.FastifyInstance {
13 pool: DynamicThreadPool<ThreadWorkerData, ThreadWorkerResponse>
14 execute: (
15 data?: ThreadWorkerData,
16 name?: string,
17 transferList?: TransferListItem[]
18 ) => Promise<ThreadWorkerResponse>
19 }
20 }