import { PptxSlide } from 'pptx-viewer-core'; import { CanvasSize, FieldSubstitutionContext } from 'pptx-viewer-shared'; import { Translator } from '../../i18n/translator'; export interface RasterizeSlideDeps { doc: Document; /** Host the off-screen capture stage is appended to; removed on `destroy()`. */ container: HTMLElement; getSlides(): PptxSlide[]; getCanvasSize(): CanvasSize; getMediaDataUrls(): Map; getTranslator(): Translator; /** Opt-in WebGL SmartArt renderer flag; see `PowerPointViewerProps.smartArt3D`. */ smartArt3D: boolean; /** * Opt-in WebGL surface-chart renderer flag; see * `PowerPointViewerProps.surfaceChart3D`. */ surfaceChart3D: boolean; /** * Opt-in WebGL bar3D-chart renderer flag; see * `PowerPointViewerProps.barChart3D`. */ barChart3D: boolean; /** * Opt-in WebGL line3D-chart renderer flag; see * `PowerPointViewerProps.lineChart3D`. */ lineChart3D: boolean; /** * Opt-in WebGL area3D-chart renderer flag; see * `PowerPointViewerProps.areaChart3D`. */ areaChart3D: boolean; /** * Opt-in WebGL pie3D-chart renderer flag; see * `PowerPointViewerProps.pieChart3D`. */ pieChart3D: boolean; /** * Deck-level OOXML field-substitution context. The capture stage is mounted * outside the viewer tree, so without this an exported PNG/PDF would print * the authored "Slide #" placeholder while the screen shows "Slide 1". * `SlideStage` re-points its per-slide fields at the slide being captured. */ getFieldContext?: () => FieldSubstitutionContext | undefined; /** * Overridable frame-wait before capture (test seam: the real * `requestAnimationFrame` double-wait is not worth driving through fake * timers). Defaults to {@link nextFrame}. */ waitForFrame?: () => Promise; } export interface RasterizeSlideController { /** Render slide `index` off-screen at scale 1 and capture it with html2canvas-pro. */ rasterizeSlide(index: number): Promise; /** Remove the off-screen capture stage from the DOM. */ destroy(): void; } /** * Build the off-screen capture stage used by PNG/PDF export: a hidden host * (fixed off-canvas, `aria-hidden`) that mounts one slide at a time via * Svelte 5's imperative `mount()` API (the same `mount`/`unmount` pair the * component tests use to render outside the normal component tree), then * rasterises it with `renderToCanvas`. The mounted `SlideStage` instance is * torn down with `unmount()` and replaced on every call, and again in * `destroy()`. * * Svelte port of the vanilla binding's `createRasterizeSlide` * (`packages/vanilla/src/viewer/export/rasterize-slide.ts`): vanilla builds * the stage DOM directly via the shared `renderSlideStage`; this binding * instead mounts the real `SlideStage.svelte` component, seeding the i18n and * SmartArt-3D context it reads deep in the element tree (those contexts are * otherwise only provided by the live `PowerPointViewer` root). */ export declare function createRasterizeSlide(deps: RasterizeSlideDeps): RasterizeSlideController; //# sourceMappingURL=rasterize-slide.d.ts.map