/** What the daemon records about itself at startup. */ export interface DaemonRecord { /** Process id of the daemon. */ pid: number; /** Port it bound. Needed to confirm identity via /status, and to fall back to a port lookup. */ port: number; /** Bind address, for the same confirmation. */ bind: string; /** Server version, so a caller can report what it is about to stop. */ version: string; /** Discriminates successive daemons that happen to reuse a pid. */ bootId: string; /** Epoch milliseconds at startup. */ startedAt: number; } /** The one path this module owns. `stateDir` must already be home-expanded. */ export declare function pidfilePath(stateDir: string): string; /** * Record the running daemon. Never throws: a failed write costs the fast path * for `mma stop`, not the daemon. * * @returns true when the record was written. */ export declare function writePidfile(stateDir: string, record: DaemonRecord): boolean; /** * Read the record, or null when it is absent, unreadable, or does not parse * into a complete record. * * Incomplete is treated as absent on purpose. A half-written file (a daemon * killed mid-write) must not produce a record with a pid and a missing port, * because a caller would then fall back to signalling on the pid alone. */ export declare function readPidfile(stateDir: string): DaemonRecord | null; /** Remove the record. Never throws — called on a shutdown path that must finish. */ export declare function removePidfile(stateDir: string): void; //# sourceMappingURL=pidfile.d.ts.map