import type { HeapSample } from "./control-server.js"; declare function deadlineFor(pathname: string): number; /** Where the control server will put `.heapsnapshot`, so the client can watch it grow. */ export declare function snapshotPathFor(workDir: string, name: string): string; /** Judging a wait by bytes on disk instead of by the clock. */ export type SnapshotWatch = { /** The file the measured process is writing. */ file: string; /** Give up after this long with no new bytes. */ stallMs: number; /** Give up after this long regardless of progress. */ hardCapMs: number; /** How often to look. */ pollMs: number; }; declare function request(port: number, pathname: string, deadlineMs?: number, watch?: SnapshotWatch): Promise; /** Forces GC in the measured process and returns a settled memory sample. */ export declare function requestGc(port: number): Promise; /** * Reads memory without collecting. Used to poll a process under load, where a * forced GC would change the number being read. */ export declare function requestMemory(port: number): Promise; /** * Forces GC, writes a named heap snapshot, and returns its path and sample. * * Pass `workDir` — the same directory the control server writes into — to have * the wait judged by bytes reaching disk rather than by the clock. Without it * the call falls back to the plain wall-clock bound, which cannot tell a big * snapshot from a wedged process. */ export declare function requestSnapshot(port: number, name: string, workDir?: string): Promise<{ file: string; sample: HeapSample; }>; /** Test seam: the production deadlines would make a hung-server test take minutes. */ export declare const requestWithDeadline: typeof request; /** * Test seam for the disk-progress watch. Same reason as the deadline seam: the * production stall window is five minutes, and the behaviour worth proving — * that a growing file buys more time and a still one does not — is about the * shape of the wait, not its length. */ export declare const requestWatchingFile: typeof request; /** * Test seam for the deadline table itself. A mutation run showed the mapping * could quietly send `/snapshot?name=x` to the 30-second default instead of * its 30-minute bound — reinstating, from the inside, the exact ceiling this * client exists to remove. */ export declare const deadlineForOperation: typeof deadlineFor; export {};