import type { Note, NoteReply, PPTAnimation, PPTAudioElement, PPTElement, PPTElementLink, PPTLatexElement, PPTLineElement, PPTShapeElement, PPTTableElement, Slide, SlideTheme, TableCell, TableCellStyle } from '../../types/slides'; import type { FikaAudioElementPatch, FikaCommandIssue, FikaCommandType, FikaCreateAudioInput, FikaElementTransformPatch, FikaLatexElementInput, FikaMediaAsset, FikaMediaAssetInput, FikaMediaAssetKind, FikaNoteInput, FikaNotePatch, FikaNoteReplyInput, FikaTableElementPatch } from './types'; export declare function clonePlain(value: T): T; export declare function clonePatch(patch: T): T; export declare function createId(prefix: string): string; export declare function createIssue(code: string, message: string, path?: string, recoverable?: boolean): FikaCommandIssue; export declare function normalizeMediaExt(ext?: string): string | undefined; export declare function inferMediaExtFromMime(mimeType?: string): string | undefined; export declare function inferMediaMimeFromExt(ext?: string): string | undefined; export declare function inferMediaExtFromSrc(src: string, mimeType?: string): string | undefined; export declare function inferMediaMimeFromSrc(src: string, ext?: string): string | undefined; export declare function resolveMediaAsset(asset: FikaMediaAssetInput, kind?: FikaMediaAssetKind): FikaMediaAsset; export declare function isCanonicalCommandType(type: string): type is FikaCommandType; export type IdMap = Record; export interface ElementCloneOptions { animationIdMap?: IdMap; elementIdMap?: IdMap; groupIdMap?: IdMap; offset?: number | { left?: number; top?: number; }; preserveExternalSlideLinks?: boolean; slideIdMap?: IdMap; } export interface ClonedElements { elements: PPTElement[]; animations: PPTAnimation[]; elementIdMap: IdMap; groupIdMap: IdMap; animationIdMap: IdMap; } export interface ClonedSlides extends ClonedElements { slides: Slide[]; slideIdMap: IdMap; } export declare function toIdList(id: string | string[]): string[]; export declare function clampIndex(index: number, length: number): number; export declare function insertIndex(index: number | undefined, length: number): number; export declare function ensureSlide(slides: Slide[], slideId?: string, fallbackIndex?: number): { slide: Slide; index: number; }; export declare function findElement(slides: Slide[], elementId: string, slideId?: string, fallbackIndex?: number): { slide: Slide; slideIndex: number; element: PPTElement; elementIndex: number; }; export declare function ensureElementOnSlide(slide: Slide, elementId: string): void; export declare function createSlideIdMap(slides: Slide[]): IdMap; export declare function createElementIdMap(elements: PPTElement[]): { elementIdMap: IdMap; groupIdMap: IdMap; }; export declare function normalizeElementLink(link: PPTElementLink | undefined, slides: Slide[]): PPTElementLink | undefined; export interface SlideLinkReference { slideId: string; elementId: string; target: string; } export declare function findSlideLinkReferences(slides: Slide[], targetIds?: Set): SlideLinkReference[]; export declare function remapElementSlideLinks(elements: PPTElement[], slideIdMap: Map | IdMap): number; export declare function cloneElementsWithRemappedIds(elements: PPTElement[], animations?: PPTAnimation[], options?: ElementCloneOptions): ClonedElements; export declare function cloneSlidesWithRemappedIds(slides: Slide[], options?: { preserveExternalSlideLinks?: boolean; slideIdMap?: IdMap; }): ClonedSlides; export declare function normalizeSlide(slide?: Partial): Slide; export declare function normalizeElement(element: Partial & { type: PPTElement['type']; }, theme?: SlideTheme): PPTElement; export declare function flattenElementTransform(input: T & { transform?: FikaElementTransformPatch; }): Omit & FikaElementTransformPatch; export declare function normalizeAudioElement(input: FikaCreateAudioInput, defaultColor: string): PPTAudioElement; export declare function normalizeAudioPatch(patch: FikaAudioElementPatch): Partial; export declare function resolveShapeFormula(element: PPTShapeElement): PPTShapeElement; export declare function normalizeShapeElement(element?: Partial): PPTShapeElement; export declare function mergeShapeElement(base: PPTShapeElement, patch: Partial): PPTShapeElement; export interface LatexGeometry { path: string; viewBox: [number, number]; width: number; height: number; } /** * Render a LaTeX formula to its SVG path + intrinsic box via hfmath — the EXACT * pipeline the interactive LaTeXEditor uses (`new hfmath(latex).pathd()/box()`). * * The agent supplies only the `latex` string; it cannot pre-compute the SVG * `path`. Without a path the `` renders nothing, so a "latex" element from * the agent shows up blank. Deriving the path here makes agent-authored formulas * render identically to ones drawn through the editor UI. */ export declare function deriveLatexGeometry(latex: string): LatexGeometry; export declare function normalizeLatexElement(element: FikaLatexElementInput): PPTLatexElement; export declare function normalizeLineElement(element: Partial & { type?: 'line'; }): PPTLineElement; export declare function updateLineElement(element: PPTLineElement, patch: Partial): PPTLineElement; export declare function remapElementGroupIds(elements: PPTElement[]): PPTElement[]; export declare function normalizeAnimation(animation: Partial & { elId: string; effect: string; type: PPTAnimation['type']; }): PPTAnimation; export declare function normalizeNote(note: FikaNoteInput): Note; export declare function normalizeNotePatch(patch: FikaNotePatch): Partial; export declare function normalizeReply(reply: FikaNoteReplyInput): NoteReply; export declare function createTableCell(text?: string, style?: TableCellStyle): TableCell; export declare function normalizeTableColWidths(colWidths: number[] | undefined, colCount: number): number[]; export declare function normalizeTableElement(element?: Partial, theme?: SlideTheme): PPTTableElement; export declare function normalizeTableElementPatch(table: PPTTableElement, patch: FikaTableElementPatch): Partial; export declare function mergeTheme(theme: SlideTheme, patch: Partial): SlideTheme;