Avena Webapp API - v0.0.1
    Preparing search index...

    Module plot/export-sink

    Saving an export: streamed straight to a file where the browser has the File System Access API (showSaveFilePicker, Chromium browsers), otherwise through a download link for the finished Blob (Firefox, Safari).

    The save picker needs a user gesture, so the page calls pickSaveFile synchronously in the export click handler, before its first await. The chunks are then passed to downloadExportViaNats as its onChunk hook (see runAndSaveExport): every chunk is written to the file, and the write finishes, before the chunk is acknowledged. A slow disk therefore slows the exporter down instead of piling data up in memory, and no other copy of the export is kept.

    Interfaces

    SaveFileHandle
    SaveFileWritable

    Functions

    isPickerCancelled
    pickSaveFile
    runAndSaveExport
    suggestedExportFileName