UNPKG

@getanthill/datastore

Version:

Event-Sourced Datastore

25 lines (24 loc) 947 B
/// <reference types="node" /> /// <reference types="node" /> import type { Server } from '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>; }