UNPKG

@lokalise/fastify-extras

Version:

Opinionated set of fastify plugins, commonly used in Lokalise

12 lines (11 loc) 533 B
import type { Either } from '@lokalise/node-core'; import type { AnyFastifyInstance } from '../pluginsCommon.js'; export type HealthChecker = (app: AnyFastifyInstance) => Promise<Either<Error, true>>; /** * Returns error (if fail) or null (if pass) */ export type HealthCheckerSync = (app: AnyFastifyInstance) => Error | null; /** * Return a function which executes healthcheck and throws an error if it fails */ export declare const wrapHealthCheck: (app: AnyFastifyInstance, healthCheck: HealthChecker) => () => Promise<void>;