OptionalgetRestores the stored history. Called once, when the viewer starts.
OptionalgetRestores a stored page-one preview, as an image Blob, a URL / data-URL string, or
null when there is none. key is the opaque id the viewer passed to
IRecentsConfig.setRecentThumbnail.
Kept apart from the list on purpose: the list is small metadata rewritten on every
open, a preview is a one-off blob better kept out of it (and out of localStorage).
Omit both callbacks and previews simply last for the session.
OptionalmaxHow many entries to keep. Defaults to 20.
OptionalsetStores the history, newest first — called after every change (open, save elsewhere, clear).
OptionalsetStores the page-one preview the viewer rendered for an entry, under that entry's IRecentEntry.key.
Deleting them is yours as well, because only you know where they went — and it needs no extra callback: every IRecentsConfig.setRecents call carries the whole list, so dropping every stored preview whose key is not in it prunes the entries that were removed, cleared or pushed off the end of the list. Doing it there also collects anything orphaned by an earlier crash, which a "preview removed" notification never would.
Persistence for the recent-documents history — the only part of it the host owns.
The viewer keeps the list itself: it records each open, orders and de-duplicates the entries, caps their number and empties them on "Clear all". Without this config all of that still works, but only until the page is reloaded. Implement
getRecents+setRecentsand the history survives, in whatever storage you like.The "Recents" tab appears whenever at least one readable source is configured, independently of this config; hide it with
layoutConfig.chooseFile.recents: false.Example