From 1d47e0729e6ab6089af2166d02b2dad8a2798aec Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Mon, 18 Jul 2016 16:57:15 -0700 Subject: [PATCH] update transform reference --- docs/reference/models/transform.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/reference/models/transform.md b/docs/reference/models/transform.md index ba3048c44..d8b39f1d0 100644 --- a/docs/reference/models/transform.md +++ b/docs/reference/models/transform.md @@ -11,6 +11,8 @@ All changes are performed through `Transform` objects, so that a history of chan Transform methods can either operate on the [`Document`](./document.md), the [`Selection`](./selection.md), or both at once. +- [Methods](#methods) + - [`apply`](#apply) - [Document & Selection Transforms](#document-selection-transforms) - [`deleteBackward`](#deletebackward) - [`deleteForward`](#deleteforward) @@ -56,11 +58,19 @@ Transform methods can either operate on the [`Document`](./document.md), the [`S - [`unwrapInlineAtRange`](#unwrapinlineatrange) - [`wrapBlockAtRange`](#wrapblockatrange) - [`wrapInlineAtRange`](#wrapinlineatrange) +- [History Transforms](#history-transforms) + - [`redo`](#redo) + - [`undo`](#undo) +## Methods +### `apply` +`apply(options: Object) => State` +Applies all of the current transform steps, returning the newly transformed [`State`](./state.md). An `options` object is optional, containing values of: +- `snapshot: Boolean` — override the editor's built-in logic of whether to create a new snapshot in the history, that can be reverted to later. ## Document & Selection Transforms @@ -290,3 +300,14 @@ Wrap the [`Block`](./block.md) nodes in a `range` with a new [`Block`](./block.m Wrap the [`Inline`](./inline.md) nodes in a `range` with a new [`Inline`](./inline.md) node of `type`, with optional `data`. +## History Transforms + +### `redo` +`redo() => Transform` + +Move forward one step in the history. + +### `undo` +`undo() => Transform` + +Move backward one step in the history.