import process from 'node:process'; import { type FatalErrorService, type Knifecycle, type ServiceProperties } from 'knifecycle'; import { type LogService } from 'common-services'; import { type AppEnvVars, type BaseAppEnv } from './ENV.js'; export interface ProcessService { service: NodeJS.Process; dispose: () => Promise; } export interface ProcessServiceConfig { PROCESS_NAME?: string; SIGNALS?: NodeJS.Signals[]; } export type ProcessServiceDependencies = ProcessServiceConfig & { ENV: AppEnvVars; APP_ENV: T; exit: typeof process.exit; $instance: Knifecycle; $fatalError: FatalErrorService; log?: LogService; }; /** * Instantiate the process service * @name initProcess * @function * @param {Object} services * The services `process` depends on * @param {Object} services.APP_ENV * The injected `APP_ENV` value * @param {Object} [services.PROCESS_NAME] * The process name to display * @param {Object} [services.SIGNALS] * The process signals that interrupt the process * @param {Object} [services.exit] * A `process.exit` like function * @param {Object} services.$instance * The Knifecycle instance * @param {Object} services.$fatalError * The Knifecycle fatal error manager * @param {Object} [services.log=noop] * An optional logging service * @return {Promise} * A promise of the process object */ declare function initProcess({ ENV, APP_ENV, PROCESS_NAME, SIGNALS, log, exit, $instance, $fatalError, }: ProcessServiceDependencies): Promise; declare const _default: ServiceProperties & typeof initProcess; export default _default;