import { PptxElement, PptxSlide, TextSegment } from 'pptx-viewer-core'; /** * Pure, immutable slide-array mutations for the Svelte editor. * * Mirrors the vanilla binding's `editor-mutations` (in turn the Vue binding's * `useEditorOperations` commit helpers), minus the reactivity: every function * takes the current `PptxSlide[]` and returns a brand-new array (untouched * slides are reused by reference so the render layer can cheaply detect * changes). All cloning defers to the core helpers (`cloneSlide`, * `cloneElement`, `duplicateElement`); nothing is mutated in place. */ /** Geometry patch applied by drag / resize / rotate / nudge. */ export interface ElementBoxPatch { x: number; y: number; width: number; height: number; rotation: number; } /** Find a top-level element by id on the given slide (or `undefined`). */ export declare function findSlideElement(slides: readonly PptxSlide[], slideIndex: number, elementId: string): PptxElement | undefined; /** Rebuild one slide's `elements` via `mapElements`; other slides are reused. */ export declare function mapSlideElements(slides: readonly PptxSlide[], slideIndex: number, mapElements: (elements: PptxElement[]) => PptxElement[]): PptxSlide[]; /** Shallow-merge `updates` into the element with `elementId` (cloned first). */ export declare function updateElement(slides: readonly PptxSlide[], slideIndex: number, elementId: string, updates: Partial): PptxSlide[]; /** Patch an element's geometry (x/y/width/height/rotation). */ export declare function patchElementGeometry(slides: readonly PptxSlide[], slideIndex: number, elementId: string, box: ElementBoxPatch): PptxSlide[]; /** Remove the element with `elementId` from the slide. */ export declare function removeElement(slides: readonly PptxSlide[], slideIndex: number, elementId: string): PptxSlide[]; /** * Deep-clone an element (fresh ids via core `duplicateElement`, group children * included), offset it slightly, and append it to the slide. Returns the new * slide array plus the copy's id, or `null` when the source is missing. */ export declare function duplicateElementOnSlide(slides: readonly PptxSlide[], slideIndex: number, elementId: string): { slides: PptxSlide[]; newId: string; } | null; /** Deep-clone the whole slide array (history snapshots). */ export declare function cloneSlides(slides: readonly PptxSlide[]): PptxSlide[]; /** * Replace the plain-text speaker notes on one slide. Mirrors the Vue binding's * `onNotesUpdate`: only `notes` is written, `notesSegments` (rich runs loaded * from a .pptx) is intentionally left untouched, matching the plain-text * commit contract shared by every binding's notes panel. */ export declare function updateSlideNotes(slides: readonly PptxSlide[], slideIndex: number, notes: string, notesSegments?: TextSegment[]): PptxSlide[]; /** * Shallow-merge `patch` into the slide at `slideIndex` (cloned first). Other * slides are reused by reference. Backs the Design tab's Format Background * panel and the Transitions tab's single-slide apply. */ export declare function updateSlide(slides: readonly PptxSlide[], slideIndex: number, patch: Partial): PptxSlide[]; /** * Shallow-merge `patch` into every slide. Backs the Transitions tab's * "Apply to All Slides" option. */ export declare function updateAllSlides(slides: readonly PptxSlide[], patch: Partial): PptxSlide[]; //# sourceMappingURL=editor-mutations.d.ts.map