Character
import { Character } from 'slate'A character in a Text node.
Characters are how Slate associates Marks with a range of text, for formatting.
Properties
Character({
marks: Immutable.Set<Mark>,
text: String
})object
objectString
A string with a value of 'character'.
marks
marksImmutable.Set
A set of Marks attached to the character.
text
textString
The text string of the character.
Static Methods
Character.create
Character.createCharacter.create(properties: Object) => Character
Create a character from a plain Javascript object of properties.
Character.createList
Character.createListCharacter.createList(array: Array) => List
Create a list of characters from a plain Javascript array.
Character.fromJSON
Character.fromJSONCharacter.fromJSON(object: Object) => Character
Create a character from a JSON object.
Character.isCharacter
Character.isCharacterCharacter.isCharacter(maybeCharacter: Any) => Boolean
Returns a boolean if the passed in argument is a Character.
Instance Methods
toJSON
toJSONtoJSON() => Object
Returns a JSON representation of the character.
Last updated