export declare const MIRROR_WAIT_DEFAULT_MS: number; export declare class MirrorLagError extends Error { readonly sha: string; readonly waitedMs: number; readonly origins: string[]; readonly code = "mirror_lag"; constructor(sha: string, waitedMs: number, origins: string[]); } export interface MirrorDeps { /** HEAD/GET probe; returns the HTTP status (0 on a network error). */ probe?: (url: string) => Promise; origins?: (apiBase: string) => Promise; sleep?: (ms: number) => Promise; now?: () => number; } export declare const mirrorUrl: (origin: string, sha: string) => string; export declare const publicApiObjectUrl: (apiBase: string, sha: string) => string; export type MirrorState = 'served' | 'lagging' | 'not-public' | 'no-mirror'; /** One look: does any CDN origin serve the model (`served`), or is it public on the API but not yet mirrored (`lagging`)? */ export declare function probeMirror(apiBase: string, cidOrSha: string, deps?: MirrorDeps): Promise<{ state: MirrorState; origins: string[]; }>; /** * Wait until the CDN mirror serves `cidOrSha`, up to `timeoutMs`. Returns when served, when there is nothing to wait for * (`not-public`, `no-mirror`), and throws `MirrorLagError` when the mirror never caught up. */ export declare function waitForMirror(apiBase: string, cidOrSha: string, opts?: { timeoutMs?: number; log?: (line: string) => void; } & MirrorDeps): Promise<{ state: MirrorState; waitedMs: number; }>; /** Categories whose model is a public, CDN-served GLB (a private avatar's is read through a signed URL, never the mirror). */ export declare const MIRROR_WAIT_CATEGORIES: Set;