decentralised sync engine
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: route handler type

serenity b949cd1d 36e3375f

+12 -1
+12 -1
src/lib/types/routes.ts
··· 1 - import type { FastifyReply, FastifyRequest } from "fastify"; 1 + import type { 2 + FastifyReply, 3 + FastifyRequest, 4 + HookHandlerDoneFunction, 5 + } from "fastify"; 2 6 import type { WebSocket } from "ws"; 3 7 4 8 export type RouteHandler = ( ··· 6 10 reply: FastifyReply, 7 11 ) => Response | Promise<Response>; 8 12 13 + export type PreHandler = ( 14 + req: FastifyRequest, 15 + reply: FastifyReply, 16 + done: HookHandlerDoneFunction, 17 + ) => void; 18 + 9 19 export type Method = "GET" | "POST" | "PUT" | "DELETE" | "PATCH"; 10 20 11 21 export interface Route { ··· 21 31 method?: Method; 22 32 handler?: RouteHandler; 23 33 wsHandler: WsRouteHandler; 34 + preHandler?: PreHandler; 24 35 skipRegistrationCheckHttp?: true; 25 36 skipRegistrationCheckWs?: true; 26 37 }