The runtime under which this saver is created.
The version of wed for which this object is created.
The updater that the editor created for its data tree.
The editor's data tree.
The options specific to this class.
The object on which this class and subclasses may push new events.
The generation that is currently being edited. It is mutable. Derived classes can read it but not modify it.
The editor's data tree.
The updater that the editor created for its data tree.
The observable on which clients can listen for events.
Subclasses must set this variable to true if the saver is in a failed state. Note that the "failed" state is for cases where it makes no sense to attempt a recovery operation.
One effect of being in a "failed" state is that the saver won't perform a recover operation if it is in a "failed" state.
Subclasses must set this variable to true once they have finished with their initialization.
The runtime under which this saver is created.
The generation that has last been saved. Derived classes can read it but not modify it.
The version of wed for which this object is created.
Must be called by derived classes when they fail to perform their task.
Must be called by derived class upon a successful save.
true
if called for an autosave operation, false
if
not.
The generation being saved. It is necessary to pass this value due to the asynchronous nature of some saving operations.
This method returns the data to be saved in a save operation. Derived classes must call this method rather than get the data directly from the data tree.
Returns the last kind of save that occurred.
The kind. The value will be
undefined
if there has not been any save yet.
Returns information regarding whether the saver sees the data tree as having been modified since the last save occurred.
false
if the tree has not been modified. Otherwise, returns a
string that describes how long ago the modification happened.
Produces a string that indicates in human readable format when the last save occurred.
The string. The value undefined
is returned if no save has
occurred yet.
This method is to be used by wed upon encountering a fatal error. It will attempt to record the last state of the data tree before wed dies.
A promise which resolves to undefined
if the method did not do
anything because the Saver object is in an unintialized state or has
already failed. It resolves to true
if the recovery operation was
successful, and false
if not.
This method must be called when the user manually initiates a save.
A promise which resolves if the save was successful.
Changes the interval at which autosaves are performed. Note that calling this function will stop the current countdown and restart it from zero. If, for instance, the previous interval was 5 minutes, and 4 minutes had elapsed since the last save, the next autosave should happen one minute from now. However, if I now call this function with a new interval of 4 minutes, this will cause the next autosave to happen 4 minutes after the call, rather than one minute.
The interval between autosaves in milliseconds. 0 turns off autosaves.
Generated using TypeDoc
Defines a saver that uses IndexedDB to save documents.
This saver stores the document as a "file" into an IndexedDB instance. The objects are not really files but similar to files. Henceforth, the name "file" will be used without quotes to refer to the objects stored.
The version of wed for which this object is created.
The updater that the editor created for its data tree.
The editor's data tree.
The options specific to this class.