/** * The one place in the process that sends log events to a Statelog server. * * A `StatelogClient` lives for one run, but a request it started can outlive * that run: nothing waits for a log upload while a program is running. So the * list of requests still on their way belongs to the process, not to a client. * `exitProcess` waits for that list before the process exits. */ export type StatelogPost = { url: string; apiKey: string; body: string; timeoutMs: number; debugMode: boolean; }; /** * Start sending one event and return at once. The request is bounded by * `timeoutMs`, so a slow or unreachable server cannot hold up an exit for * longer than that. A failure prints only in debug mode, and never throws. */ export declare function sendStatelogPost(post: StatelogPost): void; /** * Wait for every log request still on its way, from every run in this * process. Code inside Agency calls `exitProcess`, which does this first. A * TypeScript program that runs a node and then calls `process.exit()` itself * should await this before it does. A process that ends on its own does not * need it: Node keeps running until open requests finish. */ export declare function flushPendingStatelogPosts(): Promise;