import type { HttpResponse } from '@socketsecurity/lib/http-request/response-types'; import type { JsonValue } from '@socketsecurity/lib/json/types'; export declare const HTTP_STATUS_ACCEPTED = 202; export type ProcessingBody = { id?: string | undefined; status?: string | undefined; }; export type PollCachedScanOptions = { requestFn: () => Promise; label?: string | undefined; maxPollMs?: number | undefined; pollIntervalMs?: number | undefined; now?: (() => number) | undefined; sleep?: ((ms: number) => Promise) | undefined; }; /** * Drive the 200/202 cached-scan polling loop. Resolves with the parsed JSON of * the first 200 response. Each 202 is read for its `{ status, id }` payload and * logged via debugLog. The timeout message uses the server-reported id. When * the server sends no id, it falls back to the label. A non-2xx response * throws via getResponseJson (so the caller's existing error handling fires). * Repeated 202s past maxPollMs throw a bounded timeout error naming the scan * and poll count. */ export declare function pollCachedScan(options: PollCachedScanOptions): Promise; /** * Read the `{ status, id }` payload the API sends with a 202 Accepted. Returns * undefined when the body is absent or not JSON — the loop still polls on * status alone, so a missing body never breaks polling. */ export declare function readProcessingBody(response: HttpResponse): ProcessingBody | undefined;