Slate
ExamplesGitHubSlack
main
main
  • Introduction
  • Walkthroughs
    • Installing Slate
    • Adding Event Handlers
    • Defining Custom Elements
    • Applying Custom Formatting
    • Executing Commands
    • Saving to a Database
    • Enabling Collaborative Editing
    • Using the Bundled Source
  • Concepts
    • Interfaces
    • Nodes
    • Locations
    • Transforms
    • Operations
    • Commands
    • Editor
    • Plugins
    • Rendering
    • Serializing
    • Normalizing
    • TypeScript
    • Migrating
  • API
    • Transforms
    • Node Types
      • Editor
      • Element
      • Node
      • NodeEntry
      • Text
    • Location Types
      • Location
      • Path
      • PathRef
      • Point
      • PointEntry
      • PointRef
      • Range
      • RangeRef
      • Span
    • Operation Types
      • Operation
    • Scrubber
  • Libraries
    • Slate React
      • withReact
      • ReactEditor
      • Hooks
      • Slate Component
      • Editable Component
      • Event Handling
    • Slate History
      • withHistory
      • HistoryEditor
      • History
    • Slate Hyperscript
  • General
    • Resources
    • Contributing
    • Changelog
    • FAQ
Powered by GitBook
On this page
  • Static methods
  • Manipulation methods
  • Check methods
  1. API
  2. Operation Types

Operation

PreviousOperation TypesNextScrubber

Last updated 2 years ago

Operation objects define the low-level instructions that Slate editors use to apply changes to their internal state. Representing all changes as operations is what allows Slate editors to easily implement history, collaboration, and other features.

Static methods

Manipulation methods

Operation.inverse(op: Operation) => Operation

Invert an operation, returning a new operation that will exactly undo the original when applied.

Check methods

Operation.isNodeOperation(value: any) => boolean

Check if a value is a NodeOperation object. Returns the value as a NodeOperation if it is one.

Operation.isOperation(value: any) => boolean

Check if a value is an Operation object. Returns the value as an Operation if it is one.

Operation.isOperationList(value: any) => boolean

Check if a value is a list of Operation objects. Returns the value as an Operation[] if it is one.

Operation.isSelectionOperation(value: any) => boolean

Check if a value is a SelectionOperation object. Returns the value as a SelectionOperation if it is one.

Operation.isTextOperation(value: any) => boolean

Check if a value is a TextOperation object. Returns the value as a TextOperation if it is one.

Static methods
Manipulation methods
Check methods