/** * @file The Node retry variant: a real blocking wait between attempts. * `Atomics.wait` blocks the calling thread without spinning the CPU, and * Node permits it on the main thread. Browsers do not, which is what * `./browser` exists for. */ import type { SpawnRetryFailure, SpawnRetryOptions } from './policy.js'; export * from './policy.js'; /** * Whether a blocking wait is available here. * * Node always defines `SharedArrayBuffer`, so this is true for every runtime * that can reach `spawnSync`. It is false in V8's `--build-snapshot` builder, * where the global is absent. */ export declare function canSleepSync(): boolean; /** * Run `attempt` under the retry policy, waiting between tries. */ export declare function runWithSpawnRetry(attempt: () => Result, options?: SpawnRetryOptions | undefined): Result; /** * Block the calling thread for `ms`. Returns whether the wait happened. * * The `try` is not defensive padding. `Atomics.wait` throws a `TypeError` on a * thread that may not block, and a cross-origin-isolated browser main thread * DEFINES `SharedArrayBuffer` while still forbidding the wait. Testing the * global alone therefore passes and then throws. Reporting false there keeps * the contract: no wait means the caller makes one attempt. */ export declare function sleepSync(ms: number): boolean;