@@ -137,12 +137,12 @@ The available options are listed in the tables below:
137137
138138> \* default values written in related object
139139
140- | key | type | default | description |
141- | -------- - | ------------------------------------ - | ------ - | -------------------------------------------------------------------------------------------------------- |
142- | size | ` number ` | | Maximum amount of snapshots a history can hold . If the maximum is reached the first one will be removed . |
140+ | key | type | default | description |
141+ | -------- - | ---------------------------------- - | ------ - | -------------------------------------------------------------------------------------------------------- |
142+ | size | ` number ` | | Maximum amount of snapshots a history can hold . If the maximum is reached the first one will be removed . |
143143| filter | [` FilterFunction ` ](#filterfunction ) | | Determines whether the given mutation is supported |
144- | histories | ` HistoriesOptions ` | \* | Options related to the histories |
145- | transform | ` TransformOptions ` | \* | Options related to serializing and deserializing state - data |
144+ | histories | ` HistoriesOptions ` | \* | Options related to the histories |
145+ | transform | ` TransformOptions ` | \* | Options related to serializing and deserializing state - data |
146146
147147> All the options above are optional
148148
@@ -152,19 +152,19 @@ The available options are listed in the tables below:
152152
153153The options beneath are required when the ` histories ` - object is passed .
154154
155- | key | type | default | description |
156- | -------- | ---------------------------------------- - | ------------------------------------ - | ---------------------------------------------------------------- - |
155+ | key | type | default | description |
156+ | -------- | -------------------------------------- - | ------------------------------------ - | ---------------------------------------------------------------- - |
157157| allocate | [` AllocateFunction ` ](#allocatefunction ) | returns first key of ` histories.keys ` | Determines which history / histories an snapshot should be added to |
158- | keys | ` string[] ` | ` ['default'] ` | For each given key a separate history will be created |
158+ | keys | ` string[] ` | ` ['default'] ` | For each given key a separate history will be created |
159159
160160< br / >
161161
162162#### ` transform ` - Options
163163
164164The options beneath are required when the ` transform ` - object is passed .
165165
166- | key | type | default | description |
167- | ---------- - | ---------------------------------------------- - | ------------------------------ - | -------------------------------------------------------------------- - |
166+ | key | type | default | description |
167+ | ---------- - | -------------------------------------------- - | ------------------------------ - | -------------------------------------------------------------------- - |
168168| serialize | [` SerializeFunction ` ](#serializefunction ) | returns complete state | Reduces the state - object when it will be added to the history |
169169| deserialize | [` DeserializeFunction ` ](#deserializefunction ) | returns complete snapshot - state | Will be used to merge the reduced state - object with the current state |
170170
@@ -211,8 +211,8 @@ All properties are `readonly` and cannot be replaced.
211211
212212For all these methods the ` historyKey ` will be the first key in [` histories.keys ` ](#histories - options ) of the options .
213213
214- | signature | description |
215- | -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- - |
214+ | signature | description |
215+ | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ - |
216216| ` getHistory(historyKey?: string): VuexHistory ` | returns the [` VuexHistory ` ](#vuexhistory ) with the given key ; if there is no history for the key , an error will be thrown |
217217| ` serialize(historyKey?: string, state: any): any ` | serializes the given state , you can read more [here ](#serializefunction ) |
218218| ` deserialize(historyKey?: string, data: any): any ` | deserialized the given data to a state , you can read more [here ](#deserializefunction ) |
@@ -233,23 +233,23 @@ A [`VuexHistory`](#vuexhistory)-object has the following properties and methods:
233233
234234#### Methods
235235
236- | signature | description |
237- | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
238- | ` addSnapshot(snapshot: HistorySnapshot): VuexHistory ` | adds an snapshot to the history |
239- | ` getSnapshot(index: number): HistorySnapshot ` < code > & #124 ;< / code > ` undefined ` | returns a copy of an snapshot of the history |
240- | ` removeSnapshot(index: number): HistorySnapshot ` < code > & #124 ;< / code > ` undefined ` | deletes an snapshot of the history |
241- | ` updateSnapshot(index: number, snapshot: HistorySnapshot): VuexHistory ` | updates an snapshot of the history |
242- | ` addSnapshot(snapshot: HistorySnapshot): VuexHistory ` | adds an snapshot to the history |
243- | ` addSnapshot(snapshot: HistorySnapshot): VuexHistory ` | adds an snapshot to the history |
244- | ` canUndo(): boolean ` | returns if undo is possible |
245- | ` canUndo(): boolean ` | returns if undo is possible |
246- | ` undo(): VuexHistory ` | undoes the last snapshot |
247- | ` canRedo(): boolean ` | returns if redo is possible |
248- | ` redo(): VuexHistory ` | redoes the next possible snapshot |
249- | ` hasChanges(): boolean ` | returns if there are any snapshots in the history |
250- | ` overrideInitialState(state): VuexHistory ` | overrides the initial state |
251- | ` clearHistory(overrideInitialState = true): void ` | clears the history and by default overrides the initial state , this flag can be set to ` false ` to avoid overriding |
252- | ` reset(): void ` | clears the history and replaces the current state with the initial |
236+ | signature | description |
237+ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
238+ | ` addSnapshot(snapshot: HistorySnapshot): VuexHistory ` | adds an snapshot to the history |
239+ | ` getSnapshot(index: number): HistorySnapshot ` < code > & #124 ;< / code > ` undefined ` | returns a copy of an snapshot of the history |
240+ | ` removeSnapshot(index: number): HistorySnapshot ` < code > & #124 ;< / code > ` undefined ` | deletes an snapshot of the history |
241+ | ` updateSnapshot(index: number, snapshot: HistorySnapshot): VuexHistory ` | updates an snapshot of the history |
242+ | ` addSnapshot(snapshot: HistorySnapshot): VuexHistory ` | adds an snapshot to the history |
243+ | ` addSnapshot(snapshot: HistorySnapshot): VuexHistory ` | adds an snapshot to the history |
244+ | ` canUndo(): boolean ` | returns if undo is possible |
245+ | ` canUndo(): boolean ` | returns if undo is possible |
246+ | ` undo(): VuexHistory ` | undoes the last snapshot |
247+ | ` canRedo(): boolean ` | returns if redo is possible |
248+ | ` redo(): VuexHistory ` | redoes the next possible snapshot |
249+ | ` hasChanges(): boolean ` | returns if there are any snapshots in the history |
250+ | ` overrideInitialState(state): VuexHistory ` | overrides the initial state |
251+ | ` clearHistory(overrideInitialState = true): void ` | clears the history and by default overrides the initial state , this flag can be set to ` false ` to avoid overriding |
252+ | ` reset(): void ` | clears the history and replaces the current state with the initial |
253253| ` serialize(state: any): any ` | gives access to the [` SerializeFunction ` ](#serializefunction ); should be used when manually adding an snapshot ; you can read more [here ](#serializefunction ) |
254254| ` deserialize(data: any): void ` | gives access to the [` DeserializeFunction ` ](#deserializefunction ); you can read more [here ](#deserializefunction ) |
255255
0 commit comments