import type { CooldownOption } from "./types.js"; /** Parse a duration string like `'500ms'`, `'30s'`, `'1m'`, `'2h'` to milliseconds. */ export declare function parseDuration(value: string): number; /** * Per-logical-id sticky+reset state. Disabled by default — a {@link CooldownState} * is only constructed when `createRouter`'s `cooldown` option is set. * * It tracks an absolute index into the FULL (unfiltered) candidate array. After * the router switches away from the primary, that survivor stays sticky so the * next request skips the known-down primary; once `modelResetInterval` ms have * elapsed since the switch, the next request re-probes the primary. * * The `now` clock is injectable so tests can advance time deterministically. */ export declare class CooldownState { private activeFullIndex; private lastReset; private readonly cfg; private readonly now; private lastValidNow; constructor(cfg: { modelResetInterval: number; }, now?: () => number); /** Reset to the primary if the sticky window has elapsed. Call once per selection. */ checkAndReset(): void; /** The full-array index the next request should start probing from. */ current(): number; /** * Commit a survivor. Starting the reset window only when leaving the primary * means a healthy primary keeps serving and the interval is measured from the * last real switch away from it. */ advanceTo(fullIndex: number): void; private clockNow; } /** Normalize the `cooldown` option to a concrete config, or `undefined` when off. */ export declare function resolveCooldown(opt?: CooldownOption): { modelResetInterval: number; } | undefined;