Expand description

This is an abstract class representing a document and provides methods for creating and manipulating documents.

@typeparam

T - The type of data stored in the document.

@typeparam

A - The type of action the document can take.

Constructors

Constructs a BaseDocument instance with an initial state.

Properties

Accessors

Gets the timestamp of the date the document was created.

Gets the type of document.

Gets the initial state of the document.

Gets the timestamp of the date the document was last modified.

Gets the name of the document.

Gets the list of operations performed on the document.

Gets the revision number of the document.

Methods

Dispatches an action to update the state of the document.

@returns

The Document instance.

Gets the attachment associated with the given key.

Loads the state of the document from a file.

Loads a document state and a set of operations.

Removes a range of operations from the document.

Reapplies a number of actions to the document.

Saves the state of the document to a file.

@returns

The file path where the state was saved.

Sets the name of the document.

Reverts a number of actions from the document.

Loads the state of the document from a file and returns it.

@returns

The state of the document.