/** * Sync outbox consumer (GH #642). * * Drains a `SyncOutbox` by pushing each pending page to `DriveBackup`, * reusing the existing bounded-retry + revision-guard machinery from * `storage/writeBehindRetry.ts` rather than reimplementing retry/conflict * handling. */ import { type BoundedRetryOptions } from "../storage/writeBehindRetry.js"; import type { SyncOutbox } from "./outbox.js"; /** Structural subset of `DriveBackup` the worker needs — keeps this testable without real Google creds. */ export interface CloudBackup { backup(name: string, content: string): Promise; } export interface OutboxWorkerOptions { /** Read the current on-disk content for a page name, or null if it no longer exists. */ readContent: (name: string) => Promise; now?: () => string; /** Forwarded to withBoundedRetry — e.g. inject a fast `sleep` in tests. */ retryOptions?: Omit; } export declare class OutboxWorker { private readonly outbox; private readonly backup; private readonly options; private draining; private kickPending; constructor(outbox: SyncOutbox, backup: CloudBackup, options: OutboxWorkerOptions); /** * Fire-and-forget: schedule a drain pass. Safe to call repeatedly — a call * that arrives while a drain is already running just marks that another * pass is needed once the current one finishes, rather than running * concurrent drains against the same queue. */ kick(): void; /** Await the current drain pass and any chained follow-up (tests). */ whenIdle(): Promise; drain(): Promise; private drainOne; } //# sourceMappingURL=worker.d.ts.map