Encodes the workbook to bytes using the resolved format, or an alternate format key.
Optionalformat: string
An alternate format key — the one the user picked, for a resolved destination.
Optionalorigin: IWorkbookIO.Origin
The origin being written, when the store minted one for a destination it resolved. Omitted, it is origin. The caller's onWarnings sees this as the destination.
The bytes to persist, or null when the caller declined the write through
WriteOptions.onWarnings. A store that receives null persists nothing and returns
null — the same outcome as a dismissed save dialog.
Call this after resolving the destination (e.g. once a Save picker / permission prompt has
returned). The first invocation also fires the caller's ITaskProgress.onStart, so
encoding before the prompt resolves would show progress UI on top of the dialog. A store that
is cancelled should return without calling encode, so onStart never fires for it.
The resolved write format (consumer chrome — encoding runs through encode).
The destination handle: the workbook's own origin for a save, the target for a Save As or an
export. May be unbound (getPath() null) — see the store contract above.
OptionalpromptResolve a destination even when origin is bound and writable — see WriteAsOptions.prompt, whose value this carries. A store that cannot ask ignores it.
A suggested file name (with extension) for any destination prompt or default.
The workbook being written.
The request passed to IWorkbookIO.IBackingStore.write.
Remarks
The store receives the destination as an IWorkbookIO.Origin handle — never a fileName-vs-provenance ambiguity. Its contract:
size) and return it.