import type { ElementSource, Note, PPTAnimation, PPTElementEffects, PPTLatexElement, TurningMode } from '../types/slides'; export type { ElementSource }; export interface SlideObjectIdentity { order: number; objectId: string; name?: string; partPath: string; /** Position/size in points (pptxtojson units, pre-viewport scale) */ left: number; top: number; width: number; height: number; effects?: PPTElementEffects; } export interface PptxSlideTransition { type: string; duration?: number; direction?: string | null; } export interface PptxMathElement { type: 'math'; left: number; top: number; width: number; height: number; latex?: string; picBase64?: string; order?: number; } type XmlNode = { tagName?: string; attributes?: Record; children?: Array; }; /** * Map pptxtojson / OOXML transition type (+ optional direction) → Fika turningMode. */ export declare function mapPptxTransitionToTurningMode(transition?: PptxSlideTransition | null): TurningMode | undefined; /** * Normalize OMML→LaTeX quirks from real PowerPoint / pptxtojson output: * - NBSP → space * - Mathematical Alphanumeric Symbols (italic/bold/…) → ASCII */ export declare function normalizeImportedLatex(latex: string): string; /** * Build an editable LaTeX element from a pptxtojson math node. * Falls back to null when latex is missing (caller may keep the PNG). */ export declare function buildLatexElementFromMath(el: PptxMathElement, options?: { color?: string; id?: string; }): PPTLatexElement | null; /** * Parse author lists from either: * - legacy `ppt/commentAuthors.xml` (`p:cmAuthor`) * - modern `ppt/authors.xml` (`p188:author`) */ export declare function parseCommentAuthorsXml(xml: string): Map; /** * Parse a slide comments part into Fika Note[]. * Supports legacy `p:cmLst/p:cm/p:text` and modern threaded * `p188:cmLst/p188:cm` (+ `replyLst`) used by PowerPoint / pptxgenjs 4.x. */ export declare function parseCommentsXml(xml: string, authors?: Map): Note[]; /** @deprecated Use parseCommentsXml — kept for call-site compatibility. */ export declare function parseLegacyCommentsXml(xml: string, authors?: Map): Note[]; /** Parse a:effectLst into Mona-compatible PPTElementEffects (points). */ export declare function parseEffectLst(effectLst: XmlNode | undefined): PPTElementEffects | undefined; /** * Collect cNvPr identities from a slide XML part (document order). * Geometry is in points so it can match pptxtojson element boxes. */ export declare function extractCNvPrIdentitiesFromSlideXml(xml: string, partPath: string): SlideObjectIdentity[]; export declare function hashPackageId(bytes: ArrayBuffer): Promise; export interface PptxImportExtras { packageId: string; /** Comments keyed by 0-based slide index */ commentsBySlide: Map; /** cNvPr identities keyed by 0-based slide index (slide-local parts only) */ identitiesBySlide: Map; /** Click/build animations keyed by 0-based slide index (from `p:timing`) */ animationsBySlide: Map; } export interface ImportedSlideAnimation { objectId: string; trigger: PPTAnimation['trigger']; type: PPTAnimation['type']; effect: string; duration: number; } /** pptxtojson `slide.animations` item (OOXML timing, presenter order). */ export interface PptxtojsonSlideAnimation { spid: string; trigger: string; class: string; presetId: number; presetSubtype?: number; duration: number; delay?: number; filter?: string; } export declare function mapPresetToEffect(presetClass: string, presetId: number, filter?: string, presetSubtype?: number): string; /** * Parse `p:timing` click/build animations from a slide XML part. * Effect nodes are `p:cTn` with `presetClass`; `nodeType` may live on an ancestor * grouping wrapper. Document order is the presenter sequence. */ export declare function extractSlideAnimationsFromXml(xml: string): ImportedSlideAnimation[]; export declare function mapPptxtojsonAnimation(anim: PptxtojsonSlideAnimation): ImportedSlideAnimation | null; /** Map OOXML shape ids onto imported editor elements via `source.objectId` or a spid map. */ export declare function bindImportedAnimations(imported: ImportedSlideAnimation[], elements: Array<{ id: string; source?: { objectId?: string; }; }>, spidToElId?: Map): PPTAnimation[]; /** * Extract comments + cNvPr provenance from the retained OOXML package. */ export declare function extractPptxImportExtras(bytes: ArrayBuffer): Promise; export declare function attachElementSource(element: { source?: ElementSource; effects?: PPTElementEffects; }, packageId: string, identity?: SlideObjectIdentity): void; /** * Match a pptxtojson element box (points, pre-scale) to a slide-local cNvPr identity. * Consumes the identity so one OOXML object maps to one editor element. */ export declare function takeIdentityForGeometry(pool: SlideObjectIdentity[] | undefined, box: { left: number; top: number; width: number; height: number; }, epsilon?: number): SlideObjectIdentity | undefined; /** Match a pptxtojson `el.id` (cNvPr id) when geometry matching misses. */ export declare function takeIdentityForObjectId(pool: SlideObjectIdentity[] | undefined, objectId: string | undefined): SlideObjectIdentity | undefined; /** @deprecated Prefer takeIdentityForGeometry — pptxtojson order is parser-private. */ export declare function takeIdentityForOrder(pool: SlideObjectIdentity[] | undefined, order: number | undefined): SlideObjectIdentity | undefined;