A step object represents an atomic change. It generally applies only to the document it was created for, since the positions stored in it will only make sense for that document.
This module defines the behaviour that all step types must implement, and provides a registry for JSON serialization/deserialization.
Ports Step from prosemirror-transform/src/step.ts.
Summary
Callbacks
Applies this step to the given document, returning a StepResult.
Deserialize a step from its JSON representation.
Create an inverted version of this step. Needs the document as it was before the step.
Map this step through a mappable thing, returning a mapped step or nil.
Try to merge this step with another one. Returns the merged step or nil.
Get the step map that represents the changes made by this step.
Create a JSON-serializable representation of this step.
Functions
Deserialize a step from its JSON representation.
Dispatches to the registered module based on the stepType field.
Register a step module under a string ID for JSON serialization. Raises if the ID is already registered.
Callbacks
@callback apply(step :: term(), doc :: term()) :: ProsemirrorEx.Transform.StepResult.t()
Applies this step to the given document, returning a StepResult.
Deserialize a step from its JSON representation.
Create an inverted version of this step. Needs the document as it was before the step.
Map this step through a mappable thing, returning a mapped step or nil.
Try to merge this step with another one. Returns the merged step or nil.
@callback step_map(step :: term()) :: ProsemirrorEx.Transform.StepMap.t()
Get the step map that represents the changes made by this step.
Create a JSON-serializable representation of this step.