import { type PlanLimitRefusal } from "./plan-limit.js"; /** A refused file is retried after this long even if nothing else changed. */ export declare const PLAN_LIMIT_PAUSE_RETRY_MS: number; /** Test-only clock override; `null` restores `Date.now`. */ export declare function setPlanLimitPauseClockForTesting(now: (() => number) | null): void; /** Current time as the pause store sees it. */ export declare function planLimitPauseNow(): number; /** Where the pause record for `scope` lives. */ export declare function planLimitPausePath(scope: string): string; /** * The pause record for one vault. Load once per push pass with * {@link PlanLimitPauseStore.open}, consult {@link isPaused} while admitting * uploads, then apply the pass's outcome and {@link save}. */ export declare class PlanLimitPauseStore { /** Null when the scope cannot name a file; the store then never persists. */ private readonly file; private data; private dirty; private constructor(); /** Read the record for `scope`; never throws. */ static open(scope: string): PlanLimitPauseStore; /** Last refusal recorded for this vault, if any path is still paused. */ get refusal(): PlanLimitRefusal | undefined; /** Number of recorded paths (including ones whose pause has lapsed). */ get size(): number; /** * Epoch ms after which `relativePath` is retried, or undefined when it has * no pause in effect at `now`. A pause is in effect only while * `pausedAt <= now < pausedAt + PLAN_LIMIT_PAUSE_RETRY_MS`: a future stamp, * or an end further than one retry window ahead, is a clock change and is * ignored. */ pausedUntil(relativePath: string, now?: number): number | undefined; /** True while `relativePath` is inside its pause window at `now`. */ isPaused(relativePath: string, now?: number): boolean; /** True when any recorded path is paused at `now`. */ hasActivePauses(now?: number): boolean; /** * Replace the stored refusal details (for example with a fresh 402 from an * admission check) without restarting any pause window. */ refreshRefusal(refusal: PlanLimitRefusal): void; /** Record `paths` as refused at `now`, restarting their pause window. */ pause(paths: readonly string[], refusal: PlanLimitRefusal, now: number): void; /** Drop every pause: the plan state changed. */ clear(): void; /** * Persist the record. Lapsed entries are pruned first, so files that were * deleted or uploaded elsewhere do not accumulate. An empty record removes * the file. Write failures are swallowed: the record is advisory. */ save(now?: number): void; } /** * Forget recorded plan-limit refusals so the next sync pass retries paused * files at once. Call after a plan change (for example an upgrade). With no * `scope`, clears every vault's record. */ export declare function clearPlanLimitPauses(scope?: string): void; //# sourceMappingURL=plan-limit-pause.d.ts.map