import { PYGMALION_PREVIEW_CAPTURE_PROGRESS_SUFFIX } from '../contract/paths.js'; import type { EditorRuntime } from '../core/runtime.js'; export { PYGMALION_PREVIEW_CAPTURE_PROGRESS_SUFFIX }; export type PygmalionPreviewCaptureProgressPhase = 'idle' | 'queued' | 'preparing' | 'capturing' | 'retrying' | 'finalizing'; export interface PygmalionPreviewCaptureProgress { active: boolean; phase: PygmalionPreviewCaptureProgressPhase; completed: number; total: number; jobCount: number; /** Stable worker-job identity used to join consecutive capture batches. */ jobId?: string; /** Current worker batch, when the public counters represent the whole catalog. */ batchCompleted?: number; /** Current worker batch size, when the public counters represent the whole catalog. */ batchTotal?: number; frameId?: string; captureStatus?: string; updatedAt?: number; } export interface PygmalionPreviewCaptureCatalogProgress { active: boolean; completed: number; total: number; jobCount: number; updatedAt?: number; } export declare function previewCaptureProgressEndpoint(artifactEndpoint: string): string; export declare function normalizePreviewCaptureProgress(value: unknown): PygmalionPreviewCaptureProgress | null; /** * Reads a worker batch as part of the catalog. The catalog's own count is the * only count: the worker batch says what is moving, and its numbers ride along * for the batch detail, but never add to or hold up the catalog's. */ export declare function mergePreviewCaptureProgress(worker: PygmalionPreviewCaptureProgress, catalog: PygmalionPreviewCaptureCatalogProgress): PygmalionPreviewCaptureProgress; /** * Reads the local preview worker's current progress from the artifact plugin. * Idle polling is deliberately slower; an active capture tightens the interval * so a multi-minute job stays legible without holding a streaming connection. * * Polls the given transport, or the mounted editor's when rendered inside * one, and only while that transport has a progress endpoint configured. */ export declare function usePygmalionPreviewCaptureProgress(runtime: EditorRuntime): PygmalionPreviewCaptureProgress; /** One editor's catalog capture progress channel, published by the canvas probe. */ export declare function createPreviewCaptureProgress(): { getPreviewCaptureCatalogProgress: () => PygmalionPreviewCaptureCatalogProgress; subscribePreviewCaptureCatalogProgress: (listener: () => void) => () => void; publishPreviewCaptureCatalogProgress: (value: PygmalionPreviewCaptureCatalogProgress) => void; resetPreviewCaptureCatalogProgress: () => void; getPreviewCaptureWorkerProgress: () => PygmalionPreviewCaptureProgress; subscribePreviewCaptureWorkerProgress: (listener: () => void) => () => void; publishPreviewCaptureWorkerProgress: (value: PygmalionPreviewCaptureProgress, reader?: unknown) => void; withdrawPreviewCaptureWorkerProgress: (reader: unknown) => void; }; export type PreviewCaptureProgress = ReturnType;