UNPKG

@getanthill/datastore

Version:

Event-Sourced Datastore

23 lines (22 loc) 890 B
import type { Server } from 'node:http'; import type { ProcessDestroySignal, Services } from './typings'; import express from 'express'; export default class App { services: Services; express: express.Express | null; server: Server | null; isAlive: boolean; constructor(services: Services); bind(): this; start(): Promise<this | undefined>; stop(): Promise<unknown>; restart(): Promise<this>; signalHandler(signal: ProcessDestroySignal): () => Promise<NodeJS.Timeout>; errorHandler(signal: ProcessDestroySignal): (err: Error) => Promise<NodeJS.Timeout>; /** * Cleanup and stop the process properly, then exit the process. * @param signal - Signal to stop the process with * @param err - Error that caused the destruction of the process */ destroy(signal: ProcessDestroySignal, err?: Error): Promise<NodeJS.Timeout>; }