history
Documentation / editor/modules/history
HistoryModule​
Defined in: editor/modules/history.ts:24
Properties​
Property | Type | Defined in |
---|---|---|
() => | editor/modules/history.ts:31 | |
() => | editor/modules/history.ts:30 | |
() => | editor/modules/history.ts:33 | |
() => | editor/modules/history.ts:27 | |
() => | editor/modules/history.ts:26 | |
editor/modules/history.ts:25 | ||
() => | editor/modules/history.ts:29 | |
( | editor/modules/history.ts:32 | |
() => | editor/modules/history.ts:28 |
Methods​
destroy()​
destroy(): void;
Defined in: editor/modules/history.ts:34
Returns​
void
Options​
Defined in: editor/modules/history.ts:15
Properties​
Property | Type | Defined in |
---|---|---|
| editor/modules/history.ts:16 | |
| editor/modules/history.ts:17 | |
| editor/modules/history.ts:18 |
StackEntry​
Defined in: editor/modules/history.ts:5
Properties​
Property | Type | Defined in |
---|---|---|
editor/modules/history.ts:6 | ||
editor/modules/history.ts:7 |
UndoStack​
Defined in: editor/modules/history.ts:10
Properties​
Property | Type | Defined in |
---|---|---|
editor/modules/history.ts:12 | ||
editor/modules/history.ts:11 |
history()​
const history: (editor: Editor) => object;
Defined in: editor/modules/history.ts:22
Parameters​
Parameter | Type |
---|---|
|
Returns​
object
Name | Type | Defined in |
---|---|---|
| () => | editor/modules/history.ts:161 |
| {
| editor/modules/history.ts:167 |
| () => | editor/modules/history.ts:160 |
| () => | editor/modules/history.ts:163 |
| () => | editor/modules/history.ts:157 |
| () => | editor/modules/history.ts:156 |
| editor/modules/history.ts:155 | |
| () => | editor/modules/history.ts:159 |
| ( | editor/modules/history.ts:162 |
| {
| editor/modules/history.ts:171 |
| () => | editor/modules/history.ts:158 |
| () => | editor/modules/history.ts:181 |
| () => | editor/modules/history.ts:164 |
| () => | editor/modules/history.ts:177 |
initHistory()​
function initHistory(initOptions: Partial<Options>): (editor: Editor) => object;
Defined in: editor/modules/history.ts:53
History is a view module for storing user changes and undoing/redoing those changes.
Stores history for all user-generated changes. Like-changes will be combined until a selection or a delay timeout cuts off the combining. E.g. if a user types "Hello" the 5 changes will be combined into one history entry. If the user moves the cursor somewhere and then back to the end and types " World" the next 6 changes are combined separately from the first 5 because selection changes add a cutoff history entries.
The default options can be overridden by passing alternatives to history. To add a timeout to force a cutoff after so many milliseconds set a delay like this:
const modules = {
history: history({ delay: 4000 })
};
Parameters​
Parameter | Type |
---|---|
|
|
Returns​
(editor: Editor): object;
Parameters​
Parameter | Type |
---|---|
|
Returns​
object
Name | Type | Defined in |
---|---|---|
| () => | editor/modules/history.ts:161 |
| {
| editor/modules/history.ts:167 |
| () => | editor/modules/history.ts:160 |
| () => | editor/modules/history.ts:163 |
| () => | editor/modules/history.ts:157 |
| () => | editor/modules/history.ts:156 |
| editor/modules/history.ts:155 | |
| () => | editor/modules/history.ts:159 |
| ( | editor/modules/history.ts:162 |
| {
| editor/modules/history.ts:171 |
| () => | editor/modules/history.ts:158 |
| () => | editor/modules/history.ts:181 |
| () => | editor/modules/history.ts:164 |
| () => | editor/modules/history.ts:177 |
transformHistoryStack()​
function transformHistoryStack(stack: UndoStack, delta:
| default
| default): void;
Defined in: editor/modules/history.ts:196
Parameters​
Parameter | Type |
---|---|
| |
|
Returns​
void
undoStack()​
function undoStack(): UndoStack;
Defined in: editor/modules/history.ts:189