import { type Carousel, type Layer } from "../../shared/carousel.js";
export interface CarouselOpsContext {
    workId: string;
    /** Override for tests / non-default work roots. Defaults to ~/.autoviral/works. */
    worksRoot?: string;
}
export declare function carouselPathFor(ctx: CarouselOpsContext): string;
export declare function readCarouselFor(ctx: CarouselOpsContext): Promise<Carousel>;
export declare function writeCarouselFor(ctx: CarouselOpsContext, carousel: Carousel): Promise<void>;
export declare function mutateCarouselFor(ctx: CarouselOpsContext, mutator: (carousel: Carousel) => Carousel, onCommitted?: (next: Carousel) => void): Promise<Carousel>;
/**
 * Resolve a `set-layer` request against a slide's existing layers, returning
 * the validated Layer to store. Pure (no IO) so the route and unit tests share
 * one code path.
 *
 * - No matching id (or no id) → CREATE: validate `incoming` as a full layer
 *   (`LayerSchema.parse` fills per-kind defaults), minting an id if absent.
 * - Matching id → PATCH: deep-merge `incoming` onto the existing layer so
 *   unsupplied fields are PRESERVED, then re-validate. A kind change on a
 *   matched id throws (kind is not patchable, mirroring patchClipProps).
 *
 * Throws on a malformed layer (unknown kind, missing required field, kind
 * change) — the caller surfaces it as a 400 + code:4 and the carousel is left
 * untouched.
 */
export declare function applyLayerPatch(existingLayers: readonly Layer[], incoming: Record<string, unknown>): Layer;
//# sourceMappingURL=carousel-ops.d.ts.map