export type DeadlineResult = { ok: true; value: T; } | { ok: false; timedOut: true; }; /** Default bound for a git-bridge hook phase (#33). Generous enough for a large-diff * ingest under contention, short enough that a hung hook never strands `git`. */ export declare const DEFAULT_HOOK_TIMEOUT_MS = 30000; /** * Resolve the git-hook deadline from the environment. `AVCS_HOOK_TIMEOUT_MS=0` * explicitly disables the bound (restores the old block-forever behavior); a missing, * empty, non-numeric, or negative value falls back to {@link DEFAULT_HOOK_TIMEOUT_MS}. */ export declare function hookTimeoutMs(env?: NodeJS.ProcessEnv): number; /** * Await `fn()` for at most `ms` milliseconds. Resolves `{ok:true, value}` if it * finishes in time, or `{ok:false, timedOut:true}` if the deadline elapses first. * A non-positive `ms` disables the bound (await `fn` to completion). Errors thrown * by `fn` propagate unchanged — a timeout is distinct from a failure. */ export declare function withDeadline(fn: () => Promise, ms: number): Promise>; /** * The hard deadline that backs a cooperative stop at `ms` (#181). The capture is asked to stop * at `ms` and needs a moment to finish the op in flight and flush its staged batch; only if it * cannot stop on its own does the process get exited, at this later bound. `0` (unbounded) * stays unbounded. */ export declare function hardDeadlineMs(ms: number): number; //# sourceMappingURL=deadline.d.ts.map