API
Location Types
Path
16min
path arrays are a list of indexes that describe a node's exact position in a slate node tree although they are usually relative to the root editor object, they can be relative to any node object type path = number\[] path docid\ n l3fc wo avn3esh8zyppath docid\ n l3fc wo avn3esh8zyppath docid\ n l3fc wo avn3esh8zyppath docid\ n l3fc wo avn3esh8zyp static methods retrieval methods path ancestors(path path, options { reverse? boolean } = {}) path\[] get a list of ancestor paths for a given path the paths are sorted from deepest to shallowest ancestor however, if the reverse true option is passed, they are reversed path common(path path, another path) path get the common ancestor path of two paths path compare(path path, another path) 1 | 0 | 1 compare a path to another, returning an integer indicating whether the path was before, at, or after the other note two paths of unequal length can still receive a 0 result if one is directly above or below the other if you want exact matching, use \[\[path equals]] instead path levels(path path, options?) path\[] get a list of paths at every level down to a path note this is the same as path ancestors , but including the path itself the paths are sorted from shallowest to deepest however, if the reverse true option is passed, they are reversed options {reverse? boolean} path next(path path) path given a path, get the path to the next sibling node path parent(path path) path given a path, return a new path referring to the parent node above it path previous(path path) path given a path, get the path to the previous sibling node path relative(path path, ancestor path) path get a path relative to an ancestor check methods check some attribute of a path always returns a boolean path endsafter(path path, another path) boolean check if a path ends after one of the indexes in another path endsat(path path, another path) boolean check if a path ends at one of the indexes in another path endsbefore(path path, another path) boolean check if a path ends before one of the indexes in another path equals(path path, another path) boolean check if a path is exactly equal to another path hasprevious(path path) boolean check if the path of previous sibling node exists path isafter(path path, another path) boolean check if a path is after another path isancestor(path path, another path) boolean check if a path is an ancestor of another path isbefore(path path, another path) boolean check if a path is before another path ischild(path path, another path) boolean check if a path is a child of another path iscommon(path path, another path) boolean check if a path is equal to or an ancestor of another path isdescendant(path path, another path) boolean check if a path is a descendant of another path isparent(path path, another path) boolean check if a path is the parent of another path ispath(value any) value is path check is a value implements the path interface path issibling(path path, another path) boolean check if a path is a sibling of another transform method path transform(path path, operation operation, options?) path | null transform a path by an operation options { affinity? 'forward' | 'backward' | null }
🤔
Have a question?
Our super-smart AI,knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.