import { Client as SDK } from '@nosana/sdk'; import { Provider } from '../../provider/Provider.js'; import { NodeRepository } from '../../repository/NodeRepository.js'; import type NodeManager from '../../index.js'; export declare class ApiHandler { private sdk; private repository; private provider; private port; private api; private address; private server; private wss; private eventEmitter; private apiCheckTimer; private failedProxyRestarts; /** * Where the node's progress into the job loop is kept. The API outlives the * node's own restarts, and the process that replaces this one on a restart * resumes there. */ nodeManager?: NodeManager; constructor(sdk: SDK, repository: NodeRepository, provider: Provider, port: number); start(): Promise; preventMultipleApiStarts(): Promise; testApiServerOnce(server: string, timeoutMs?: number): Promise; private restartApiProxy; private stopApiProxy; private startWebSocketServer; private startApiCheck; /** * Check the API, scheduling the next check once this one is done: a rebuild * takes as long as an image pull, and two cannot both create the proxy. */ private scheduleApiCheck; /** * End the process once the proxy counts as lost, so a fresh one can build it: * nothing else in this process rebuilds it. A job in flight outranks that, * since resuming a flow runs its operations again, and an unreachable registry * is not something a new process fixes. */ private endNodeIfProxyIsLost; private registerRoutes; private listen; private stopApiCheck; stopServerAndWebSocket(): void; stop(): Promise; }