@piggly/fastify-chassis
Version:
An ESM/CommonJS toolkit to help you to do common operations in your back-end applications with Fastify and NodeJS.
19 lines (18 loc) • 661 B
TypeScript
import type { DefaultEnvironment } from '../types';
/**
* Process stop error.
*
* It will wait for:
* - EventBus cleanup;
* - LoggerService flush and cleanup.
*
* You may not need to cleanup classes above when using this.
*
* @param {Environment} env
* @param {() => Promise<number>} beforeExit
* @param {number} exitCode Used when beforeExit is not provided. Default is 0.
* @returns The callback function.
* @since 5.1.0
* @author Caique Araujo <caique@piggly.com.br>
*/
export declare const processStop: <Environment extends DefaultEnvironment>(env: Environment, beforeExit?: () => Promise<number>, exitCode?: number) => () => Promise<never>;