TheSunny
doc-ios
doc-ios
  • Introduction
  • Walkthroughs
    • Installing Slate
    • Adding Event Handlers
    • Defining Custom Block Nodes
    • Applying Custom Formatting
    • Using Plugins
    • Saving to a Database
    • Saving and Loading HTML Content
  • Guides
    • Changes
    • Data Model
    • Plugins
    • Rendering
    • Schemas
  • General
    • Plugins
    • Resources
    • Contributing
    • Changelog
    • FAQ
  • Slate Core
    • Block
    • Change
    • Character
    • Data
    • Document
    • Inline
    • Mark
    • Node
    • Operation
    • Range
    • Schema
    • Text
    • Value
    • setKeyGenerator
    • resetKeyGenerator
  • Slate React
    • Editor
    • Plugins
    • Custom Nodes
    • Core Plugins
    • cloneFragment
    • findDOMNode
    • findDOMRange
    • findNode
    • findRange
    • getEventRange
    • getEventTransfer
    • setEventTransfer
  • Other Packages
    • slate-html-serializer
    • slate-hyperscript
    • slate-plain-serializer
    • slate-prop-types
    • slate-schema-violations
    • slate-simulator
  • Contributing
    • iOS Development Guide
Powered by GitBook
On this page
  • Properties
  • key
  • nodes
  • object
  • Computed Properties
  • text
  • Methods
  • filterDescendants
  • findDescendant
  • getBlocksAtRange
  • getBlocks
  • getCharactersAtRange
  • getChild
  • getClosestBlock
  • getClosestInline
  • getClosest
  • getDepth
  • getDescendant
  • getFirstText
  • getFragmentAtRange
  • getFurthest
  • getFurthestAncestor
  • getFurthestBlock
  • getFurthestInline
  • getFurthestOnlyChildAncestor
  • getInlinesAtRange
  • getLastText
  • getMarksAtRange
  • getNextBlock
  • getNextSibling
  • getNextText
  • getParent
  • getPreviousBlock
  • getPreviousSibling
  • getPreviousText
  • getTextAtOffset
  • getTextsAtRange
  • hasChild
  • hasDescendant
  1. Slate Core

Node

PreviousMarkNextOperation

Last updated 7 years ago

Node is not a publicly accessible module, but instead an interface that , and all implement.

Properties

key

String

A short-lived, unique identifier for the node.

By default, keys are not meant to be long-lived unique identifiers for nodes that you might store in a database, or elsewhere. They are meant purely to identify a node inside of a single Slate instance. For that reason, they are simply auto-incrementing strings. (eg. '0', '1', '2', ...)

If you want to make your keys uniqueness long-lived, you'll need to supply your own key generating function via the setKeyGenerator util.

nodes

Immutable.List

A list of child nodes. Defaults to a list with a single text node child.

object

String

An immutable string value of 'document', 'block', 'inline' or 'text' for easily separating this node from or nodes.

Computed Properties

text

String

Methods

filterDescendants

filterDescendants(iterator: Function) => List

Deeply filter the descendant nodes of a node by iterator.

findDescendant

findDescendant(iterator: Function) => Node || Void

Deeply find a descendant node by iterator.

getBlocksAtRange

getBlocksAtRange(range: Range) => List

getBlocks

getBlocks() => List

getCharactersAtRange

getCharactersAtRange(range: Range) => List

getChild

getChild(key: String || Node) => Node || Void

Get a child by key.

getClosestBlock

getClosestBlock(key: String || Node) => Node || Void

getClosestInline

getClosestInline(key: String || Node) => Node || Void

getClosest

getClosest(key: String || Node, match: Function) => Node || Void

Get the closest parent node of a descendant node by key that matches a match function.

getDepth

getDepth(key: String || Node) => Number

Get the depth of a descendant node by key.

getDescendant

getDescendant(key: String || Node) => Node || Void

Get a descendant node by key.

getFirstText

getFirstText() => Node || Void

Get the first child text node inside a node.

getFragmentAtRange

getFragmentAtRange(range: Range) => Document

Get a document fragment of the nodes in a range.

getFurthest

getFurthest(key: String, iterator: Function) => Node || Null

Get the furthest parent of a node by key that matches an iterator.

getFurthestAncestor

getFurthestAncestor(key: String) => Node || Null

Get the furthest ancestor of a node by key.

getFurthestBlock

getFurthestBlock(key: String) => Node || Null

Get the furthest block parent of a node by key.

getFurthestInline

getFurthestInline(key: String) => Node || Null

Get the furthest inline parent of a node by key.

getFurthestOnlyChildAncestor

getFurthestOnlyChildAncestor(key: String) => Node || Null

Get the furthest ancestor of a node by key that has only one child.

getInlinesAtRange

getInlinesAtRange(range: Range) => List

getLastText

getLastText() => Node || Void

Get the last child text node inside a node.

getMarksAtRange

getMarksAtRange(range: Range) => Set

Get a set of all of the marks in a range.

getNextBlock

getNextBlock(key: String || Node) => Node || Void

getNextSibling

getNextSibling(key: String || Node) => Node || Void

Get the next sibling of a descendant by key.

getNextText

getNextText(key: String || Node) => Node || Void

getParent

getParent(key: String || Node) => Node || Void

Get the parent node of a descendant by key.

getPreviousBlock

getPreviousBlock(key: String || Node) => Node || Void

getPreviousSibling

getPreviousSibling(key: String || Node) => Node || Void

Get the previous sibling of a descendant by key.

getPreviousText

getPreviousText(key: String || Node) => Node || Void

getTextAtOffset

getTextAtOffset(offset: Number) => Text || Void

getTextsAtRange

getTextsAtRange(range: Range) => List

hasChild

hasChild(key: String || Node) => Boolean

Check whether the node has a child node by key.

hasDescendant

hasDescendant(key: String || Node) => Boolean

Check whether the node has a descendant node by key.

A concatenated string of all of the descendant nodes of this node.

Get all of the bottom-most nodes in a range.

Get all of the bottom-most node descendants.

Get a list of all of the in a range.

Get the closest node to a descendant node by key.

Get the closest node to a descendant node by key.

Get all of the top-most nodes in a range.

Get the next, bottom-most node after a descendant by key.

Get the next node after a descendant by key.

Get the previous, bottom-most node before a descendant by key.

Get the previous node before a descendant by key.

Get the node at an offset.

Get all of the nodes in a range.

Document
Block
Inline
Inline
Text
Text
Block
Block
Characters
Block
Inline
Inline
Block
Text
Block
Text
Text
Text