Text API
5 min
text objects represent the nodes that contain the actual text content of a slate document along with any formatting properties they are always leaf nodes in the document tree as they cannot contain any children interface text { text string } static methods docid\ betyldif4i5yq3z0elzqsretrieval methods docid\ betyldif4i5yq3z0elzqscheck methods docid\ betyldif4i5yq3z0elzqs static methods retrieval methods text matches(text text, props partial\<text>) => boolean check if text matches a set of props the way the check works is that it makes sure that (a) all the props exist in the text , and (b) if it exists, that it exactly matches the properties in the text if a props text property is passed in, it will be ignored if there are properties in text that are not in props , those will be ignored when it comes to testing for a match text decorations(node text, decorations range\[]) => text\[] get the leaves for a text node, given decorations check methods text equals(text text, another text, options?) => boolean check if two text nodes are equal options {loose? boolean} loose? when true , it checks if the properties of the text object are equal except for the text property (i e the string value of the text ) when false (default), checks all properties including text text istext(value any) => value is text check if a value implements the text interface text istextlist(value any) value is text\[] check if value is an array of only text objects