import { fork } from 'node:child_process'; import { EventEmitter } from 'node:events'; import type { App } from '@t4h.framework/core'; export type AppManifest = ReturnType; export type AppProcessState = 'idle' | 'starting' | 'ready' | 'exited'; export declare class AppProcessNotReadyError extends Error { readonly name = "AppProcessNotReadyError"; } export interface AppProcessOptions { workerPath?: string; readyTimeoutInMs?: number; killTimeoutInMs?: number; fork?: typeof fork; } export interface AppProcessUpOptions { /** Public origin of the HTTP server in front of this process; webhooks build callback URLs on it. */ serverUrl?: string; } export declare class AppProcess extends EventEmitter { private readonly workerPath; private readonly readyTimeoutInMs; private readonly killTimeoutInMs; private readonly forkProcess; private readonly server; private child; private client; private ready; private currentManifest; private currentState; constructor({ workerPath, readyTimeoutInMs, killTimeoutInMs, fork: forkProcess, }?: AppProcessOptions); get manifest(): AppManifest | null; get state(): AppProcessState; up(entrypoint: string, env: Record, { serverUrl }?: AppProcessUpOptions): Promise; down(): Promise; private kill; whenReady(): Promise; call(method: string, ...params: unknown[]): Promise; private onManifest; private onExit; }