import type { BatchItem, ComposeRequest, GenerationStatus, StudioRatio, StudioStyle } from "../api/generation"; /** The refType every composed asset carries. Mirrors model.ComposeRefType. */ export declare const COMPOSE_REF_TYPE = "ai"; /** Permanent provenance, never removed. Mirrors model.TagAIGenerated. */ export declare const TAG_AI_GENERATED = "ai-generated"; export interface ComposeParams { prompt: string; style: StudioStyle; ratio: StudioRatio; count: number; refAssetId?: string; refRatio?: string; refTmpToken?: string; refStrength?: number; /** For the batch header only — never sent. */ refLabel?: string; restaurantId?: string; } export interface StudioItem { taskId: string; assetId: string; imageId: string; status: GenerationStatus; attempts: number; error?: string; url?: string; width?: number; height?: number; fileSizeBytes?: number; /** Local only: the merchant has confirmed this one, so ai-draft is off. */ saved: boolean; } export interface StudioBatch { batchId: string; /** What this batch ran with, so regenerate and variantOf can reproduce it. */ params: ComposeParams; items: StudioItem[]; } export declare function isTerminal(status: GenerationStatus): boolean; /** * Whether a batch still has work outstanding. * * A failed item counts as finished, not running — otherwise one permanently failed image * would keep the poll loop alive for the life of the page. */ export declare function batchIsRunning(items: StudioItem[]): boolean; /** * Folds a poll's results into what is already on screen. * * `saved` is carried over because it is local state the server knows nothing about: without * that, a poll landing just after a save flips the button back to "save". * * An item the server did not mention is left untouched rather than dropped, so a partial * response cannot make tiles vanish. */ export declare function mergeBatchItems(existing: StudioItem[], fresh: BatchItem[]): StudioItem[]; /** * Maps the form's params onto the request body. * * Two things it does deliberately: drops `refLabel`, which exists only for the batch header, * and omits `refStrength` when nothing is being referenced — sending it would describe a * control the request does not have. */ export declare function toComposeRequest(params: ComposeParams): ComposeRequest;