UNPKG

@lokalise/fastify-extras

Version:

Opinionated set of fastify plugins, commonly used in Lokalise

18 lines (17 loc) 603 B
import type { CommonLogger } from '@lokalise/node-core'; import type { FastifyPluginCallback, FastifyServerOptions } from 'fastify'; declare module 'fastify' { interface FastifyRequest { reqContext: RequestContext; } } export interface BaseRequestContext { logger: CommonLogger; reqId: string; } declare module 'fastify' { interface RequestContext extends BaseRequestContext { } } export declare function getRequestIdFastifyAppConfig(): Pick<FastifyServerOptions, 'genReqId' | 'requestIdHeader'>; export declare const requestContextProviderPlugin: FastifyPluginCallback;