/* tslint:disable */ /* eslint-disable */ export class Presentation { free(): void; [Symbol.dispose](): void; /** * A textual trace of a slide's draw commands. * * Not part of the public TS API. It is what the golden harness diffs when a pixel * difference needs to be pinned on layout rather than on rasterisation — the single * most common ambiguity in this project. */ debugTrace(index: number, viewport_w: number, viewport_h: number): string; /** * Bytes of an embedded font part, by relationship id. * * PowerPoint obfuscates embedded fonts by XOR-ing the first 32 bytes with the GUID * in the file name; `fntdata` parts in `.pptx` are not obfuscated, so the bytes are * handed over as-is and the host wraps them in a `FontFace`. */ embeddedFontBytes(rel_id: string): Uint8Array | undefined; /** * Fonts the deck embeds, as JSON. The host installs these as `FontFace`s so text * renders in the authored face even on a machine that lacks it. */ embeddedFonts(): string; /** * Drops cached layouts and parsed slides. Layouts rebuild on demand. */ evictLayouts(): void; /** * Fonts a slide needs, as a JSON array of CSS `font` shorthand strings. * * The host passes these to `document.fonts.load()` before the first frame. Drawing * against a face the browser has not loaded silently substitutes it, and the result * looks exactly like a layout bug. */ fontsNeeded(index: number): string; /** * What a WebGPU backend would need for this slide. Exposed so Backend B's cost stays * visible rather than theoretical. */ gpuRequirements(index: number): string; /** * The bytes of an image, for the host to wrap in a Blob and decode. */ imageBytes(id: number): Uint8Array | undefined; /** * The MIME type of an image, so the host builds the right Blob. */ imageMime(id: number): string; /** * Marks an image as undecodable — EMF and WMF always are — so the viewer stops * asking for it every frame. */ markImageFailed(id: number): void; /** * `measureText` calls made so far. * * A figure that keeps climbing across re-renders of the same slide means the metrics * cache is being defeated, which is the first thing to check when navigation feels * slow. */ measureCalls(): number; /** * Opens a `.pptx` from its bytes. */ constructor(bytes: Uint8Array); /** * Image ids a slide still needs decoded, comma-separated. * * Decoding is the host's job: it is asynchronous, and a synchronous wasm call cannot * wait on it. The host decodes and calls [`Presentation::set_image`]. */ pendingImages(index: number): string; /** * Lays a slide out (or returns the cached layout) and reports its command count. * Hosts call this on neighbouring slides to keep navigation off the critical path. */ prepare(index: number): number; /** * Draws a slide into a 2D context. */ renderSlide(index: number, ctx: CanvasRenderingContext2D, viewport_w: number, viewport_h: number, dpr: number, fit: string, zoom: number, pan_x: number, pan_y: number): void; /** * Finds `query` on a slide and returns each match with the rectangles to highlight * it, as JSON. * * Positioned by the same walk that painted the glyphs, so a highlight cannot land * somewhere the text is not. */ searchSlide(index: number, query: string, case_sensitive: boolean, viewport_w: number, viewport_h: number, dpr: number, fit: string, zoom: number): string; /** * Hands a decoded image back so later frames can draw it. */ setImage(id: number, image: any): void; slideCount(): number; /** * Slide height in points. */ slideHeight(): number; /** * Slide metadata as JSON: `[{"index":0,"id":256,"part":"ppt/slides/slide1.xml"}, …]`. */ slideIndex(): string; /** * Speaker notes for a slide. */ slideNotes(index: number): string; /** * A slide's text, for selection, search and accessibility. */ slideText(index: number): string; /** * Slide width in points. */ slideWidth(): number; /** * Where the text is on a slide, as JSON, so the host can lay a selectable and * screen-reader-visible layer over the canvas. * * The positions come from the same walk the drawing backends use, so a run that is * culled is absent here too and the overlay cannot offer selectable text where * nothing is painted. */ textLayer(index: number, viewport_w: number, viewport_h: number, dpr: number, fit: string, zoom: number): string; } /** * Installs the panic hook. Idempotent; the host may call it more than once. */ export function start(): void; /** * Version of the wasm module, so a host can check what it loaded. */ export function version(): string; export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; export interface InitOutput { readonly memory: WebAssembly.Memory; readonly __wbg_presentation_free: (a: number, b: number) => void; readonly presentation_debugTrace: (a: number, b: number, c: number, d: number, e: number) => void; readonly presentation_embeddedFontBytes: (a: number, b: number, c: number, d: number) => void; readonly presentation_embeddedFonts: (a: number, b: number) => void; readonly presentation_evictLayouts: (a: number) => void; readonly presentation_fontsNeeded: (a: number, b: number, c: number) => void; readonly presentation_gpuRequirements: (a: number, b: number, c: number) => void; readonly presentation_imageBytes: (a: number, b: number, c: number) => void; readonly presentation_imageMime: (a: number, b: number, c: number) => void; readonly presentation_markImageFailed: (a: number, b: number) => void; readonly presentation_measureCalls: (a: number) => number; readonly presentation_new: (a: number, b: number, c: number) => void; readonly presentation_pendingImages: (a: number, b: number, c: number) => void; readonly presentation_prepare: (a: number, b: number, c: number) => void; readonly presentation_renderSlide: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void; readonly presentation_searchSlide: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void; readonly presentation_setImage: (a: number, b: number, c: number) => void; readonly presentation_slideCount: (a: number) => number; readonly presentation_slideHeight: (a: number) => number; readonly presentation_slideIndex: (a: number, b: number) => void; readonly presentation_slideNotes: (a: number, b: number, c: number) => void; readonly presentation_slideText: (a: number, b: number, c: number) => void; readonly presentation_slideWidth: (a: number) => number; readonly presentation_textLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void; readonly start: () => void; readonly version: (a: number) => void; readonly __wbindgen_export: (a: number, b: number) => number; readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_export3: (a: number) => void; readonly __wbindgen_export4: (a: number, b: number, c: number) => void; readonly __wbindgen_add_to_stack_pointer: (a: number) => number; readonly __wbindgen_start: () => void; } export type SyncInitInput = BufferSource | WebAssembly.Module; /** * Instantiates the given `module`, which can either be bytes or * a precompiled `WebAssembly.Module`. * * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. * * @returns {InitOutput} */ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; /** * If `module_or_path` is {RequestInfo} or {URL}, makes a request and * for everything else, calls `WebAssembly.instantiate` directly. * * @param {{ module_or_path: InitInput | Promise }} module_or_path - Passing `InitInput` directly is deprecated. * * @returns {Promise} */ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise;