Skip to content

API reference / Common / SaveStrategy

Type Alias: SaveStrategy ​

ts
type SaveStrategy = "rewrite" | "delta" | "incremental";

How a save writes the document — how much of the file the session was opened from (the original) the saved bytes keep. Each keeps strictly more of it than the one before:

  • Rewrite writes every part from the model; the original plays no part.
  • Delta writes only the parts the session modified, over the original, and carries every other part across as it was — a pptx's untouched zip entries, a PDF's untouched objects.
  • Incremental appends the modified parts to the original as a new revision, leaving the original's bytes an untouched prefix — what a PDF signature depends on. Only PDF saves this way.

Delta and Incremental write over the original, which the model's loader holds (ModelLoader::original), so the strategy carries no bytes, and crosses the host boundary by name ("rewrite").