Skip to content

API reference / Common / FileFormat

Type Alias: FileFormat ​

ts
type FileFormat = 
  | "pdf"
  | "docx"
  | "pptx"
  | "xlsx"
  | "csv"
  | "tsv"
  | "psv"
  | "jpg"
  | "png"
  | "gif"
  | "bmp"
  | "tiff"
  | "webp"
  | "svg"
  | "emf"
  | "wmf";

A file format a session opens and saves back to — the encoding a document arrives in, where [UDocType] is the model family it opens into.

Many formats open into one doc type: every image format opens as [UDocType::Image], and a .doc beside .docx would open as Wordprocessing. Saving is faithful — the saved file reopens as the same document — so a session saves only to its own doc type's formats; rendering it into any other is an export ([ExportFormat], [PageExportFormat]).

The udoc package is not a variant: it is not a byte format but a part store on some backend, opened and saved through open_package / save_to_package.

Crosses the host boundary by its extension ("pdf", "pptx", "jpg", …) — one spelling on the wire, in a package's metadata.json, and on a saved file.