iink-ts - v5.0.0
    Preparing search index...

    Class IIExportManager

    Export manager for InteractiveInkCanvas.

    Adds the recognition-derived formats to the local ones handled by ExportManager: text from the JIIX stroke index, and jiix/markdown/mermaid/plantuml/llm from the single JIIX export the server produces.

    Hierarchy (View Summary)

    Index
    • get localExporters(): Pick<TExporterMap, "json" | "png" | "svg">

      Exporters that need only the local model and the renderer

      Returns Pick<TExporterMap, "json" | "png" | "svg">

    • get model(): IIModel

      Returns IIModel

    • Release every object URL still held and cancel the pending revocations

      Returns void

    • Export the content and hand the resulting file to the browser.

      Parameters

      • format: TDownloadFormat

        Format to download; pdf opens the print flow instead of saving a file

      • options: TPDFDownloadOptions = {}

        Which symbols to export, plus the file name. The PDF settings (format/orientation/mode/scale) are ignored by every other format.

      Returns Promise<void>

      await canvas.download("svg")
      await canvas.download("markdown", { filename: "meeting-notes" })
      await canvas.download("pdf", { orientation: "landscape" })
    • Export the content in the given format.

      Type Parameters

      Parameters

      • format: F

        Format to export to; the resolved type follows from it

      • Optionaloptions: TExportOptions

        Which symbols to export

      Returns Promise<TExportResultMap[F]>

      Promise resolving with the exported content

      const symbols = await canvas.exportAs("json")
      const svg = await canvas.exportAs("svg", { scope: "selection" })
    • Single access point to the JIIX export — every recognition-derived format goes through it.

      Returns Promise<TJIIXExport>

      JIIX is produced server-side for the whole content, so the export options do not apply: scope and symbols are ignored by the formats derived from it.

    • Rasterize the rendered symbols to PNG.

      Parameters

      Returns Promise<Blob>

      The rasterization goes through image.onload, so it is genuinely asynchronous — the returned promise settles only once the bitmap exists. Empty content short-circuits: a zero-sized image never fires load, which would leave the promise pending forever.

    • Extract the recognized text of the given symbols in reading order.

      Strokes carrying JIIX metadata contribute their block label once, whatever the number of strokes the block spans, and sort by their own bounding box rather than by draw order.

      Parameters

      Returns string

    • Build the download file name. The timestamp is a truncated ISO 8601 instant so the name is locale-independent and free of / and :, which browsers mangle in file names.

      Parameters

      • extension: string
      • Optionalfilename: string

      Returns string

    • Parameters

      • fileName: string
      • urlData: string

      Returns void

    logger: Logger
    managerName: string = "IIExportManager"
    OBJECT_URL_REVOKE_DELAY_MS: 1000

    Delay before an object URL handed to the browser is revoked. Revoking synchronously after the anchor click cancels the download in some browsers, so the URL outlives the click by a beat.

    pdfExport: PDFExportManager