{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "api-slate-editor-api-docs",
  "title": "Editor API",
  "description": "API reference for the Editor API.",
  "files": [
    {
      "path": "../../content/docs/api/slate/editor-api.mdx",
      "content": "---\ntitle: Editor API\ndescription: API reference for the Editor API.\n---\n\nThe Editor API provides a set of helper functions for querying and manipulating the editor state.\n\n## Common Options\n\n### `At`\n\nA location reference in the editor. Can be either a Location or a Node.\n\n```ts\ntype At = TLocation | TNode\n```\n\nWhen a Node is passed, its path will be found using [`editor.api.findPath()`](/docs/api/slate/editor-api#findpath). This allows you to reference a location by either:\n- A [Location](/docs/api/slate/location) ([Path](/docs/api/slate/path), [Point](/docs/api/slate/point), or [Range](/docs/api/slate/range))\n- A [Node](/docs/api/slate/node)\n\nExample:\n```ts\n// Using a location\neditor.api.nodes({ at: [0, 0] }) // Path location\neditor.api.nodes({ at: { path: [0], offset: 0 } }) // Point location \neditor.api.nodes({ at: { anchor: point1, focus: point2 } }) // Range location\n\n// Using a node reference\nconst node = editor.children[0]\neditor.api.nodes({ at: node }) // Will find node's path internally\n```\n\n### Match\n\nA predicate for matching nodes. The predicate can be either:\n- A function that takes a `node` and its `path` and returns a `boolean`\n- An object where each key-value pair must match the node's properties\n  - Values can be single values or arrays of values to match against\n\nExample:\n```ts\n// Function predicate\neditor.api.nodes({\n  match: (node) => node.type === 'p'\n})\n\n// Object predicate\neditor.api.nodes({\n  match: { type: 'p' }\n})\n\n// Object predicate with multiple possible values\neditor.api.nodes({\n  match: { type: ['p', 'h1'] }\n})\n```\n\n### `QueryMode`\n\nMode for querying nodes in a hierarchy.\n\n<API name=\"QueryMode\">\n<APIOptions type=\"QueryMode\">\n  <APIItem name=\"mode\" type=\"'all' | 'highest' | 'lowest'\" optional>\n    - `'all'` (default): Return all matching nodes\n    - `'highest'`: In a hierarchy of nodes, only return the highest-level matching nodes\n    - `'lowest'`: In a hierarchy of nodes, only return the lowest-level matching nodes\n\n    Example:\n    ```ts\n    // Given this structure:\n    // - blockquote (matches)\n    //   - paragraph (matches)\n    //     - text\n    \n    // mode: 'all' returns both blockquote and paragraph\n    editor.api.nodes({ match: { type: ['blockquote', 'paragraph'] }, mode: 'all' })\n    \n    // mode: 'highest' returns only blockquote\n    editor.api.nodes({ match: { type: ['blockquote', 'paragraph'] }, mode: 'highest' })\n    \n    // mode: 'lowest' returns only paragraph\n    editor.api.nodes({ match: { type: ['blockquote', 'paragraph'] }, mode: 'lowest' })\n    ```\n  </APIItem>\n</APIOptions>\n</API>\n\n### `QueryOptions`\n\nCommon options for querying nodes in the editor.\n\n<API name=\"QueryOptions\">\n<APIOptions type=\"QueryOptions<V>\">\n  <APIItem name=\"at\" type=\"At\" optional>\n    Where to start querying from. Defaults to current editor selection.\n  </APIItem>\n  <APIItem name=\"block\" type=\"boolean\" optional>\n    Match block nodes. When true, only matches block elements.\n  </APIItem>\n  <APIItem name=\"empty\" type=\"boolean\" optional>\n    Match empty/non-empty nodes.\n    - When true, matches only empty nodes\n    - When false, matches only non-empty nodes\n  </APIItem>\n  <APIItem name=\"id\" type=\"boolean | string\" optional>\n    Match the node by id.\n    - When true, matches all nodes with an id\n    - When string, matches nodes with that specific id\n  </APIItem>\n  <APIItem name=\"match\" type=\"Predicate<NodeIn<V>>\" optional>\n    Custom function or object to match nodes.\n    - Function: `(node, path) => boolean`\n    - Object: Key-value pairs that should match the node\n  </APIItem>\n  <APIItem name=\"text\" type=\"boolean\" optional>\n    Match text nodes. When true, matches only text nodes.\n  </APIItem>\n</APIOptions>\n</API>\n\n## `editor.api`\n\n### `above`\n\nGet the matching ancestor above a location in the document.\n\n<API name=\"above\">\n<APIOptions type=\"EditorAboveOptions<V>\">\n  <APIItem name=\"...options\" type=\"QueryOptions<V>\" optional>\n    Common query options.\n  </APIItem>\n  <APIItem name=\"mode\" type=\"QueryMode\" optional>\n    Query mode options.\n  </APIItem>\n  <APIItem name=\"voids\" type=\"boolean\" optional>\n    Whether to include void nodes in the search.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"NodeEntry<N> | undefined\">\n  A tuple containing the matching ancestor node and its path, or `undefined` if no match is found.\n</APIReturns>\n</API>\n\n### `block`\n\nGet the block at a location or find the first block that matches options.  \nBlocks are typically top-level nodes, so this is a common way to retrieve the ancestor block.\n\n```ts\neditor.api.block() // Get block above selection\neditor.api.block({ above: true }) // Get block above selection\neditor.api.block({ at: [0, 0] }) // Get block at [0, 0]\neditor.api.block({ at: [0, 0], above: true }) // Get block at [0]\neditor.api.block({ highest: true }) // Get highest block at selection\n```\n\n<API name=\"block\">\n<APIOptions type=\"EditorBlockOptions<V>\">\n  <APIItem name=\"...options\" type=\"QueryOptions<V>\" optional>\n    Common query options for matching blocks.\n  </APIItem>\n  <APIItem name=\"at\" type=\"At | Span\" optional>\n    The location to query at. Defaults to current selection.\n  </APIItem>\n  <APIItem name=\"ignoreNonSelectable\" type=\"boolean\" optional>\n    Whether to ignore non-selectable nodes during traversal.\n  </APIItem>\n  <APIItem name=\"reverse\" type=\"boolean\" optional>\n    Whether to traverse in reverse order.\n  </APIItem>\n  <APIItem name=\"universal\" type=\"boolean\" optional>\n    Whether to ensure the operation works universally across all nodes.\n  </APIItem>\n  <APIItem name=\"above\" type=\"boolean\" optional>\n    If true, get the block above the location. Ignored if `at` is not a block path.\n  </APIItem>\n  <APIItem name=\"highest\" type=\"boolean\" optional>\n    If true, get the highest block at the location (root-level block).\n  </APIItem>\n  <APIItem name=\"mode\" type=\"QueryMode\" optional>\n    Query mode for matching blocks.\n  </APIItem>\n  <APIItem name=\"voids\" type=\"boolean\" optional>\n    Whether to include void nodes in the search.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"NodeEntry<N> | undefined\">\n  The matching block node entry or `undefined` if no match is found.\n</APIReturns>\n</API>\n\n### `blocks`\n\nReturns all matching blocks.\n\n<API name=\"blocks\">\n<APIOptions type=\"EditorNodesOptions<V>\">\n  <APIItem name=\"...options\" type=\"QueryOptions<V>\" optional>\n    Common query options for matching blocks.\n  </APIItem>\n  <APIItem name=\"at\" type=\"At | Span\" optional>\n    The location to query at. Defaults to current selection.\n  </APIItem>\n  <APIItem name=\"ignoreNonSelectable\" type=\"boolean\" optional>\n    Whether to ignore non-selectable nodes during traversal.\n  </APIItem>\n  <APIItem name=\"reverse\" type=\"boolean\" optional>\n    Whether to traverse in reverse order.\n  </APIItem>\n  <APIItem name=\"universal\" type=\"boolean\" optional>\n    Whether to ensure the operation works universally across all nodes.\n  </APIItem>\n  <APIItem name=\"mode\" type=\"QueryMode\" optional>\n    Query mode for matching blocks.\n  </APIItem>\n  <APIItem name=\"voids\" type=\"boolean\" optional>\n    Whether to include void nodes in the search.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"NodeEntry<ElementIn<V>>[]\">\n  An array of matching block node entries.\n</APIReturns>\n</API>\n\n### `edgeBlocks`\n\nReturns the edge blocks above a location (default: selection).  \nUseful for retrieving the start and end block of a range.\n\n<API name=\"edgeBlocks\">\n<APIOptions type=\"EditorNodesOptions<V>\">\n  <APIItem name=\"...options\" type=\"QueryOptions<V>\" optional>\n    Common query options for matching blocks.\n  </APIItem>\n  <APIItem name=\"at\" type=\"At | Span\" optional>\n    The location to get edge blocks from. Defaults to current selection.\n  </APIItem>\n  <APIItem name=\"ignoreNonSelectable\" type=\"boolean\" optional>\n    Whether to ignore non-selectable nodes during traversal.\n  </APIItem>\n  <APIItem name=\"reverse\" type=\"boolean\" optional>\n    Whether to traverse in reverse order.\n  </APIItem>\n  <APIItem name=\"universal\" type=\"boolean\" optional>\n    Whether to ensure the operation works universally across all nodes.\n  </APIItem>\n  <APIItem name=\"mode\" type=\"QueryMode\" optional>\n    Query mode for matching blocks.\n  </APIItem>\n  <APIItem name=\"voids\" type=\"boolean\" optional>\n    Whether to include void nodes in the search.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"[NodeEntry<N1>, NodeEntry<N2>] | null\">\n  A tuple of `[startBlock, endBlock]` above the location, or `null` if not found.\n</APIReturns>\n</API>\n\n### `first`\n\nGet the first node at a location.\n\n<API name=\"first\">\n<APIParameters>\n  <APIItem name=\"at\" type=\"At\">\n    The location to get the first node from.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"NodeEntry<DescendantIn<V>> | undefined\">\n  A tuple containing the first node and its path, or undefined if not found.\n</APIReturns>\n</API>\n\n### `fragment`\n\nGet the fragment at a location or selection.\n\n<API name=\"fragment\">\n<APIParameters>\n  <APIItem name=\"at\" type=\"At | null\" optional>\n    The location to extract the fragment from. Defaults to current selection.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorFragmentOptions\" optional>\n    Options for extracting and processing the fragment.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"ElementOrTextIn<V>[] | undefined\">\n  The fragment at the location.\n</APIReturns>\n</API>\n\n### `getFragment`\n\nReturns the fragment at the current selection. Used when cutting or copying, as an example, to get the fragment at the current selection.\n\n<API name=\"getFragment\">\n<APIParameters>\n  <APIItem name=\"at\" type=\"At\" optional>\n    The location to get the fragment from. Defaults to current selection.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"ElementOrTextIn<V>[]\">\n  The fragment at the current selection.\n</APIReturns>\n</API>\n\n### `hasBlocks`\n\nCheck if a node has block children.\n\n<API name=\"hasBlocks\">\n<APIParameters>\n  <APIItem name=\"element\" type=\"ElementIn<V>\">\n    The element to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the element has block children, false otherwise.\n</APIReturns>\n</API>\n\n### `hasInlines`\n\nCheck if a node has inline and text children.\n\n<API name=\"hasInlines\">\n<APIParameters>\n  <APIItem name=\"element\" type=\"ElementIn<V>\">\n    The element to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the element has inline and text children, false otherwise.\n</APIReturns>\n</API>\n\n### `hasMark`\n\nCheck if mark is active at selection.\n\n<API name=\"hasMark\">\n<APIParameters>\n  <APIItem name=\"key\" type=\"keyof MarksIn<V>\">\n    The mark key to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the mark is active at the current selection, false otherwise.\n</APIReturns>\n</API>\n\n### `hasPath`\n\nCheck if a path exists in the editor.\n\n<API name=\"hasPath\">\n<APIParameters>\n  <APIItem name=\"path\" type=\"Path\">\n    The path to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the path exists, false otherwise.\n</APIReturns>\n</API>\n\n### `hasTexts`\n\nCheck if a node has text children.\n\n<API name=\"hasTexts\">\n<APIParameters>\n  <APIItem name=\"element\" type=\"ElementIn<V>\">\n    The element to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the element has text children, false otherwise.\n</APIReturns>\n</API>\n\n### `isAt`\n\nCheck if a location (point/range) is at a specific position.\n\n```ts\n// For ranges:\neditor.api.isAt({ text: true }) // Check if range is in a single text node\neditor.api.isAt({ block: true }) // Check if range is in a single block\neditor.api.isAt({ blocks: true }) // Check if range is across multiple blocks\neditor.api.isAt({ start: true }) // Check if range starts at block start\neditor.api.isAt({ end: true }) // Check if range ends at block end\n\n// For points:\neditor.api.isAt({ word: true }) // Check relative to word boundaries\neditor.api.isAt({ start: true }) // Check if at start\neditor.api.isAt({ end: true }) // Check if at end\n```\n\n<API name=\"isAt\">\n<APIOptions type=\"object\">\n  <APIItem name=\"at\" type=\"At\" optional>\n    The location to check. Defaults to current selection.\n  </APIItem>\n  <APIItem name=\"text\" type=\"boolean\" optional>\n    Check if range is in a single text node.\n  </APIItem>\n  <APIItem name=\"block\" type=\"boolean\" optional>\n    Check if range is in a single block.\n  </APIItem>\n  <APIItem name=\"blocks\" type=\"boolean\" optional>\n    Check if range is across multiple blocks.\n  </APIItem>\n  <APIItem name=\"start\" type=\"boolean\" optional>\n    Check if at start position.\n  </APIItem>\n  <APIItem name=\"end\" type=\"boolean\" optional>\n    Check if at end position.\n  </APIItem>\n  <APIItem name=\"word\" type=\"boolean\" optional>\n    Check relative to word boundaries.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"boolean\">\n  True if the location matches all specified position criteria, false otherwise.\n</APIReturns>\n</API>\n\n### `isCollapsed`\n\nCheck if the selection is collapsed (start and end points are the same).\n\n<API name=\"isCollapsed\">\n<APIReturns type=\"boolean\">\n  True if the selection is collapsed, false otherwise.\n</APIReturns>\n</API>\n\n### `isEdge`\n\nCheck if a point is an edge of a location.\n\n<API name=\"isEdge\">\n<APIParameters>\n  <APIItem name=\"point\" type=\"Point\">\n    The point to check.\n  </APIItem>\n  <APIItem name=\"at\" type=\"At\" optional>\n    The location to check against. Defaults to current selection.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the point is an edge of the location, false otherwise.\n</APIReturns>\n</API>\n\n\n### `isEditorEnd`\n\nCheck if selection is at editor end.\n\n<API name=\"isEditorEnd\">\n<APIReturns type=\"boolean\">\n  True if the selection is at the editor end, false otherwise.\n</APIReturns>\n</API>\n\n### `isEmpty`\n\nCheck if an element is empty, accounting for void nodes.\n\n```ts\neditor.api.isEmpty() // Check if editor is empty\neditor.api.isEmpty(at) // Check if nodes at location are empty\neditor.api.isEmpty(at, { after: true }) // Check if text after location is empty\neditor.api.isEmpty(at, { block: true }) // Check if block above location is empty\n```\n\n<API name=\"isEmpty\">\n<APIParameters>\n  <APIItem name=\"at\" type=\"At | null\" optional>\n    The location to check for emptiness. Defaults to current selection.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorEmptyOptions\" optional>\n    Options for determining emptiness.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorEmptyOptions\">\n  <APIItem name=\"...options\" type=\"QueryOptions<V>\" optional />\n  <APIItem name=\"after\" type=\"boolean\" optional>\n    Check if text after selection is empty.\n  </APIItem>\n  <APIItem name=\"block\" type=\"boolean\" optional>\n    Check if the block above location is empty.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"boolean\" />\n</API>\n\n### `isEnd`\n\nCheck if a point is the end point of a location.\n\n<API name=\"isEnd\">\n<APIParameters>\n  <APIItem name=\"point\" type=\"Point\">\n    The point to check.\n  </APIItem>\n  <APIItem name=\"at\" type=\"At\" optional>\n    The location to check against. Defaults to current selection.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the point is the end point of the location, false otherwise.\n</APIReturns>\n</API>\n\n### `isExpanded`\n\nCheck if the selection is expanded (start and end points are different).\n\n<API name=\"isExpanded\">\n<APIReturns type=\"boolean\">\n  True if the selection is expanded, false otherwise.\n</APIReturns>\n</API>\n\n### `isNormalizing`\n\nCheck if the editor is currently normalizing after each operation.\n\n<API name=\"isNormalizing\">\n<APIReturns type=\"boolean\">\n  True if the editor is currently normalizing, false otherwise.\n</APIReturns>\n</API>\n\n### `isStart`\n\nCheck if a point is the start point of a location.\n\n<API name=\"isStart\">\n<APIParameters>\n  <APIItem name=\"point\" type=\"Point\">\n    The point to check.\n  </APIItem>\n  <APIItem name=\"at\" type=\"At\" optional>\n    The location to check against. Defaults to current selection.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the point is the start point of the location, false otherwise.\n</APIReturns>\n</API>\n\n### `isSelected`\n\nCheck if a path is selected by the current selection.\n\n<API name=\"isSelected\">\n<APIParameters>\n  <APIItem name=\"target\" type=\"Path | TRange\">\n    The path or range to check.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorIsSelectedOptions\" optional>\n    Options for checking selection.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorIsSelectedOptions\">\n  <APIItem name=\"contains\" type=\"boolean\" optional>\n    Check if selection contains the entire path range.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"boolean\">\n  True if the path is selected, false otherwise.\n</APIReturns>\n</API>\n\n### `leaf`\n\nGet the leaf text node at a location.\n\n<API name=\"leaf\">\n<APIParameters>\n  <APIItem name=\"at\" type=\"At\">\n    The location to get the leaf from.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorLeafOptions\" optional>\n    Options for getting the leaf.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorLeafOptions\">\n  <APIItem name=\"depth\" type=\"number\" optional>\n    The depth to traverse to find the leaf.\n  </APIItem>\n  <APIItem name=\"edge\" type=\"LeafEdge\" optional>\n    Which edge of the location to get the leaf from (`'start' | 'end'`).\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"NodeEntry<TextIn<V>> | undefined\">\n  A tuple containing the leaf text node and its path, or undefined if not found.\n</APIReturns>\n</API>\n\n### `levels`\n\nIterate through all levels at a location. This includes all ancestors up to the root editor node.\n\n<API name=\"levels\">\n<APIOptions type=\"EditorLevelsOptions<V>\">\n  <APIItem name=\"...options\" type=\"QueryOptions<V>\" optional>\n    Common query options for matching levels.\n  </APIItem>\n  <APIItem name=\"reverse\" type=\"boolean\" optional>\n    Whether to traverse in reverse order (bottom-up vs. top-down).\n  </APIItem>\n  <APIItem name=\"voids\" type=\"boolean\" optional>\n    Whether to include void nodes in the traversal.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"Generator<NodeEntry<NodeIn<V>>, void, undefined>\">\n  A generator that yields tuples of [node, path] for each ancestor level.\n</APIReturns>\n</API>\n\n### `last`\n\nGet the last node at a location.\n\n<API name=\"last\">\n<APIParameters>\n  <APIItem name=\"at\" type=\"At\">\n    The location to get the last node from.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorLastOptions\" optional>\n    Options for getting the last node.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorLastOptions\">\n  <APIItem name=\"level\" type=\"number\" optional>\n    Get last node at this level (0-based).\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"NodeEntry<DescendantIn<V>> | undefined\">\n  A tuple containing the last node and its path, or undefined if not found.\n</APIReturns>\n</API>\n\n### `mark`\n\nReturns the selection mark value by key.\n\n<API name=\"mark\">\n<APIParameters>\n  <APIItem name=\"key\" type=\"keyof MarksIn<V>\">\n    The mark key.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"MarksIn<V>[K] | null | undefined\">\n  The mark value if it exists, null if not set, or undefined if multiple different values exist.\n</APIReturns>\n</API>\n\n### `marks`\n\nGet the marks that would be added to text at the current selection.\n\n<API name=\"marks\">\n<APIReturns type=\"MarksIn<V> | null\">\n  The marks at the current selection, or null if there are no marks.\n</APIReturns>\n</API>\n\n### `next`\n\nGet the matching node in the branch of the document after a location.\n\n<API name=\"next\">\n<APIOptions type=\"EditorNextOptions<V>\">\n  <APIItem name=\"...options\" type=\"QueryOptions<V>\" optional>\n    Common query options for matching nodes.\n  </APIItem>\n  <APIItem name=\"at\" type=\"At | Span\" optional>\n    The location to start searching from. Defaults to current selection.\n  </APIItem>\n  <APIItem name=\"mode\" type=\"QueryMode\" optional>\n    Query mode for matching nodes.\n  </APIItem>\n  <APIItem name=\"voids\" type=\"boolean\" optional>\n    Whether to include void nodes in the search.\n  </APIItem>\n  <APIItem name=\"from\" type=\"'after' | 'child'\" optional>\n    - `'after'`: Start from point after current location\n    - `'child'`: Start from the first child of current path\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"NodeEntry<DescendantIn<V>> | undefined\">\n  A tuple containing the next matching node and its path, or undefined if not found.\n</APIReturns>\n</API>\n\n\n### `node`\n\nGet the node at a location or find the first node that matches options.\n\n<API name=\"node\">\n<APIParameters>\n  <APIItem name=\"at\" type=\"At\" optional>\n    The location to get a node from.\n  </APIItem>\n  <APIItem name=\"nodeOptions\" type=\"EditorNodeOptions\" optional>\n    Options for getting a node.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorNodeOptions\">\n  <APIItem name=\"depth\" type=\"number\" optional>\n    The depth to traverse to find the node.\n  </APIItem>\n  <APIItem name=\"edge\" type=\"'start' | 'end'\" optional>\n    Which edge of the location to get the node from.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"NodeEntry<NodeIn<V>> | undefined\">\n  A tuple containing the matching node and its path, or undefined if not found.\n</APIReturns>\n</API>\n\n### `nodes`\n\nIterate through all nodes in the editor that match the given options.\n\n<API name=\"nodes\">\n<APIOptions type=\"EditorNodesOptions<V>\">\n  <APIItem name=\"...options\" type=\"QueryOptions<V>\" optional>\n    Common query options for matching nodes.\n  </APIItem>\n  <APIItem name=\"at\" type=\"At | Span\" optional>\n    Where to start iterating. Defaults to editor selection.\n  </APIItem>\n  <APIItem name=\"ignoreNonSelectable\" type=\"boolean\" optional>\n    Whether to ignore non-selectable nodes during traversal.\n  </APIItem>\n  <APIItem name=\"reverse\" type=\"boolean\" optional>\n    Whether to traverse in reverse order.\n  </APIItem>\n  <APIItem name=\"universal\" type=\"boolean\" optional>\n    Whether to ensure the operation works universally across all nodes.\n  </APIItem>\n  <APIItem name=\"mode\" type=\"QueryMode\" optional>\n    - `'all'`: Return all matching nodes\n    - `'highest'`: Return highest-level matching nodes\n    - `'lowest'`: Return lowest-level matching nodes\n  </APIItem>\n  <APIItem name=\"voids\" type=\"boolean\" optional>\n    Whether to include void nodes in the search.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"Generator<NodeEntry<DescendantIn<V>>, void, undefined>\">\n  A generator that yields tuples of [node, path] for each matching node.\n</APIReturns>\n</API>\n\n### `parent`\n\nGet the parent node of a location.\n\n<API name=\"parent\">\n<APIParameters>\n  <APIItem name=\"at\" type=\"At\" optional>\n    The location to get the parent from.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorParentOptions\" optional>\n    Options for getting the parent node.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorParentOptions\">\n  <APIItem name=\"depth\" type=\"number\" optional>\n    Number of levels to traverse up to find the parent.\n  </APIItem>\n  <APIItem name=\"edge\" type=\"'start' | 'end'\" optional>\n    Which edge of the location to get the parent from.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"NodeEntry<AncestorIn<V>> | undefined\">\n  A tuple containing the parent node and its path, or undefined if not found.\n</APIReturns>\n</API>\n\n### `previous`\n\nGet the matching node in the branch of the document before a location.\n\n<API name=\"previous\">\n<APIOptions type=\"EditorPreviousOptions<V>\">\n  <APIItem name=\"...options\" type=\"QueryOptions<V>\" optional>\n    Common query options for matching nodes.\n  </APIItem>\n  <APIItem name=\"at\" type=\"At | Span\" optional>\n    The location to start searching from. Defaults to current selection.\n  </APIItem>\n  <APIItem name=\"mode\" type=\"QueryMode\" optional>\n    Query mode for matching nodes.\n  </APIItem>\n  <APIItem name=\"voids\" type=\"boolean\" optional>\n    Whether to include void nodes in the search.\n  </APIItem>\n  <APIItem name=\"sibling\" type=\"boolean\" optional>\n    Whether to get the previous sibling node instead of any previous node.\n  </APIItem>\n  <APIItem name=\"from\" type=\"'before' | 'parent'\" optional>\n    - `'before'`: Start from point before current location\n    - `'parent'`: Start from parent of current location\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"NodeEntry<DescendantIn<V>> | undefined\">\n  A tuple containing the previous matching node and its path, or undefined if not found.\n</APIReturns>\n</API>\n\n### `prop`\n\nGet a property value from a list of nodes. Returns `undefined` if the property value is not consistent across all nodes.\n\n<API name=\"prop\">\n<APIOptions type=\"EditorPropOptions<V>\">\n  <APIItem name=\"nodes\" type=\"TElement[]\">\n    The list of nodes to get the property value from.\n  </APIItem>\n  <APIItem name=\"key\" type=\"string\" optional>\n    The property key to get from the nodes.\n  </APIItem>\n  <APIItem name=\"defaultValue\" type=\"string\" optional>\n    Default value to return if property is not found.\n  </APIItem>\n  <APIItem name=\"getProp\" type=\"(node: DescendantIn<V>) => any\" optional>\n    Custom function to extract property value from a node.\n  </APIItem>\n  <APIItem name=\"mode\" type=\"'all' | 'block' | 'text'\" optional>\n    - `'all'`: Get property from all nodes\n    - `'block'`: Get property from the first block node\n    - `'text'`: Get property from the first text node\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"string | undefined\">\n  The consistent property value across all nodes, or `undefined` if values differ.\n</APIReturns>\n</API>\n\n### `string`\n\nGet the text string content of a location.\n\n<API name=\"string\">\n<APIParameters>\n  <APIItem name=\"at\" type=\"At\" optional>\n    The location to get text content from. Defaults to current selection.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorStringOptions\" optional>\n    Options for getting text content.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorStringOptions\">\n  <APIItem name=\"voids\" type=\"boolean\" optional>\n    Whether to include text content from void nodes.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"string\">\n  The text content at the specified location.\n</APIReturns>\n</API>\n\n### `void`\n\nMatch a void node in the current branch of the editor.\n\n<API name=\"void\">\n<APIOptions type=\"EditorVoidOptions\">\n  <APIItem name=\"at\" type=\"At\" optional>\n    The location to search from. Defaults to current selection.\n  </APIItem>\n  <APIItem name=\"mode\" type=\"QueryMode\" optional>\n    Query mode for matching nodes.\n  </APIItem>\n  <APIItem name=\"voids\" type=\"boolean\" optional>\n    Whether to include void nodes in the search.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"NodeEntry<ElementIn<V>> | undefined\">\n  A tuple containing the void node and its path, or undefined if not found.\n</APIReturns>\n</API>\n\n## Location\n\n### `findPath`\n\nFind the path of a Plate node in the editor.\n\n<API name=\"findPath\">\n<APIParameters>\n  <APIItem name=\"node\" type=\"TNode\">\n    The node to find the path for in the editor tree.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorFindPathOptions\" optional>\n    Options for finding the node's path.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorFindPathOptions\">\n  <APIItem name=\"...options\" type=\"QueryOptions<Value>\" optional>\n    Common query options for finding nodes.\n  </APIItem>\n  <APIItem name=\"ignoreNonSelectable\" type=\"boolean\" optional>\n    Whether to ignore non-selectable nodes during traversal.\n  </APIItem>\n  <APIItem name=\"reverse\" type=\"boolean\" optional>\n    Whether to traverse in reverse order.\n  </APIItem>\n  <APIItem name=\"universal\" type=\"boolean\" optional>\n    Whether to ensure the operation works universally across all nodes.\n  </APIItem>\n  <APIItem name=\"mode\" type=\"QueryMode\" optional>\n    Query mode for finding nodes.\n  </APIItem>\n  <APIItem name=\"voids\" type=\"boolean\" optional>\n    Whether to include void nodes in the search.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"Path | undefined\">\n  The path of the node if found, undefined otherwise.\n</APIReturns>\n</API>\n\n### `path`\n\nGet the path of a location.\n\n<API name=\"path\">\n<APIParameters>\n  <APIItem name=\"at\" type=\"At\" optional>\n    The location to get the path from. Defaults to current selection.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"Path\">\n  The path of the location.\n</APIReturns>\n</API>\n\n### `point`\n\nGet the `start` or `end` (default is `start`) point of a location.\n\n<API name=\"point\">\n<APIParameters>\n  <APIItem name=\"at\" type=\"At\" optional>\n    The location to get the point from. Defaults to current selection.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorPointOptions\" optional>\n    Options for getting the point.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorPointOptions\">\n  <APIItem name=\"edge\" type=\"'start' | 'end'\" optional>\n    Which edge of the location to get the point from.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"Point\">\n  The point at the specified location and edge.\n</APIReturns>\n</API>\n\n### `positions`\n\nIterate through all possible point positions in the document.\n\n<API name=\"positions\">\n<APIOptions type=\"EditorPositionsOptions\">\n  <APIItem name=\"at\" type=\"At\" optional>\n    Where to start iterating. Defaults to editor selection.\n  </APIItem>\n  <APIItem name=\"unit\" type=\"TextUnitAdjustment\" optional>\n    - `'offset'`: Moves to the next offset Point\n    - `'character'`: Moves to the next character\n    - `'word'`: Moves to the position after the next word\n    - `'line'` | 'block': Moves between block boundaries\n  </APIItem>\n  <APIItem name=\"reverse\" type=\"boolean\" optional>\n    When true returns positions in reverse order.\n  </APIItem>\n  <APIItem name=\"voids\" type=\"boolean\" optional>\n    Whether to include positions inside void nodes.\n  </APIItem>\n  <APIItem name=\"ignoreNonSelectable\" type=\"boolean\" optional>\n    Whether to skip positions in non-selectable nodes.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"Generator<Point, void, undefined>\">\n  A generator that yields each valid point position in the document.\n</APIReturns>\n</API>\n\n### `nodesRange`\n\nReturns the range spanning the given node entries.\n\n<API name=\"nodesRange\">\n<APIParameters>\n  <APIItem name=\"nodes\" type=\"NodeEntry[]\">\n    The node entries to get the range for.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"TRange | undefined\">\n  The range spanning the nodes, or undefined if no valid range can be created.\n</APIReturns>\n</API>\n\n### `range`\n\nCreate a range between two locations.\n\n<API name=\"range\">\n<APIOptions type=\"EditorRangeOptions\">\n  <APIItem name=\"at\" type=\"At\" optional>\n    The location to create the range at. Defaults to current selection.\n  </APIItem>\n  <APIItem name=\"focus\" type=\"Point\" optional>\n    The focus (end) point of the range.\n  </APIItem>\n  <APIItem name=\"anchor\" type=\"Point\" optional>\n    The anchor (start) point of the range.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"TRange\">\n  A new range between the specified points.\n</APIReturns>\n</API>\n\n### `start`\n\nGet the start point of a location.\n\n<API name=\"start\">\n<APIParameters>\n  <APIItem name=\"at\" type=\"At\" optional>\n    The location to get the start point from.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorStartOptions\" optional>\n    Options for getting the start point.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorStartOptions\">\n  <APIItem name=\"next\" type=\"boolean\" optional>\n    Get the start point of the next node instead of the current one.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"Point\">\n  The start point of the location.\n</APIReturns>\n</API>\n\n### `unhangRange`\n\nConvert a range into a non-hanging one.\n\nA \"hanging\" range is one created by the browser's \"triple-click\" selection behavior. When triple-clicking a block, the browser selects from the start of that block to the start of the _next_ block. The range thus \"hangs over\" into the next block. If `unhangRange` is given such a range, it moves the end backwards until it's in a non-empty text node that precedes the hanging block.\n\nNote that `unhangRange` is designed for the specific purpose of fixing triple-clicked blocks, and therefore currently has a number of caveats:\n\n- It does not modify the start of the range; only the end. For example, it does not \"unhang\" a selection that starts at the end of a previous block.\n- It only does anything if the start block is fully selected. For example, it does not handle ranges created by double-clicking the end of a paragraph (which browsers treat by selecting from the end of that paragraph to the start of the next).\n\n<API name=\"unhangRange\">\n<APIParameters>\n  <APIItem name=\"range\" type=\"TRange\">\n    The range to unhang.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorUnhangRangeOptions\" optional>\n    Options for un-hanging the range.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorUnhangRangeOptions\">\n  <APIItem name=\"voids\" type=\"boolean\" optional>\n    Allow placing the end of the selection in a void node.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"TRange\">\n  A new range with the end point moved backwards if it was hanging.\n</APIReturns>\n</API>\n\n## Element\n\n### `elementReadOnly`\n\nCheck if an element is read-only.\n\n<API name=\"elementReadOnly\">\n<APIParameters>\n  <APIItem name=\"element\" type=\"ElementIn<V>\">\n    The element to check for read-only status.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the element is read-only, false otherwise.\n</APIReturns>\n</API>\n\n### `isBlock`\n\nCheck if a value is a block `Element` object.\n\n<API name=\"isBlock\">\n<APIParameters>\n  <APIItem name=\"value\" type=\"any\">\n    The value to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the value is a block element, false otherwise.\n</APIReturns>\n</API>\n\n### `isInline`\n\nCheck if a value is an inline `Element` object.\n\n<API name=\"isInline\">\n<APIParameters>\n  <APIItem name=\"element\" type=\"DescendantIn<V>\">\n    The element to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the element is inline, false otherwise.\n</APIReturns>\n</API>\n\n### `isSelectable`\n\nCheck if a value is a selectable `Element` object.\n\n<API name=\"isSelectable\">\n<APIParameters>\n  <APIItem name=\"element\" type=\"ElementIn<V>\">\n    The element to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the element is selectable, false otherwise.\n</APIReturns>\n</API>\n\n### `isVoid`\n\nCheck if an element is void.\n\n<API name=\"isVoid\">\n<APIParameters>\n  <APIItem name=\"element\" type=\"ElementIn<V>\">\n    The element to check for void status.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the element is void, false otherwise.\n</APIReturns>\n</API>\n\n### `markableVoid`\n\nCheck if an element is a markable void element.\n\n<API name=\"markableVoid\">\n<APIParameters>\n  <APIItem name=\"element\" type=\"ElementIn<V>\">\n    The element to check for markable void status.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the element is a markable void element, false otherwise.\n</APIReturns>\n</API>\n\n## Ref\n\n### `pathRef`\n\nCreate a mutable ref for a `Path`.\n\n<API name=\"pathRef\">\n<APIParameters>\n  <APIItem name=\"path\" type=\"Path\">\n    The path to reference.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorPathRefOptions\" optional>\n    Options for the path reference.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorPathRefOptions\">\n  <APIItem name=\"affinity\" type=\"TextDirection | null\" optional>\n    The direction to resolve the ref when ambiguous:\n    - `'forward'`: Resolve to the next valid position\n    - `'backward'`: Resolve to the previous valid position\n    - `null`: Do not resolve to any position\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"PathRef\">\n  A mutable reference that updates its path as operations are applied to the editor.\n</APIReturns>\n</API>\n\n### `pathRefs`\n\nGet the set of currently tracked path refs of the editor.\n\n<API name=\"pathRefs\">\n<APIReturns type=\"Set<PathRef>\">\n  The set of tracked path refs.\n</APIReturns>\n</API>\n\n### `pointRef`\n\nCreate a mutable ref for a `Point`.\n\n<API name=\"pointRef\">\n<APIParameters>\n  <APIItem name=\"point\" type=\"Point\">\n    The point to reference.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorPointRefOptions\" optional>\n    Options for the point reference.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorPointRefOptions\">\n  <APIItem name=\"affinity\" type=\"TextDirection | null\" optional>\n    The direction to resolve the ref when ambiguous:\n    - `'forward'`: Resolve to the next valid position\n    - `'backward'`: Resolve to the previous valid position\n    - `null`: Do not resolve to any position\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"PointRef\">\n  A mutable reference that updates its point as operations are applied to the editor.\n</APIReturns>\n</API>\n\n### `pointRefs`\n\nGet the set of currently tracked point refs of the editor.\n\n<API name=\"pointRefs\">\n<APIReturns type=\"Set<PointRef>\">\n  The set of tracked point refs.\n</APIReturns>\n</API>\n\n### `rangeRef`\n\nCreate a mutable ref for a `Range`.\n\n<API name=\"rangeRef\">\n<APIParameters>\n  <APIItem name=\"range\" type=\"TRange\">\n    The range to reference.\n  </APIItem>\n  <APIItem name=\"options\" type=\"EditorRangeRefOptions\" optional>\n    Options for the range reference.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"EditorRangeRefOptions\">\n  <APIItem name=\"affinity\" type=\"RangeDirection | null\" optional>\n    The direction to resolve the ref when ambiguous:\n    - `'forward'`: Resolve both points forward\n    - `'backward'`: Resolve both points backward\n    - `'outward'`: Resolve start backward and end forward\n    - `'inward'`: Resolve start forward and end backward\n    - `null`: Do not resolve to any position\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"RangeRef\">\n  A mutable reference that updates its range as operations are applied to the editor.\n</APIReturns>\n</API>\n\n### `rangeRefs`\n\nGet the set of currently tracked range refs of the editor.\n\n<API name=\"rangeRefs\">\n<APIReturns type=\"Set<RangeRef>\">\n  The set of tracked range refs.\n</APIReturns>\n</API>\n\n## DOM\n\n### `findDocumentOrShadowRoot`\n\nFind the document or shadow root from the editor.\n\n<API name=\"findDocumentOrShadowRoot\">\n<APIReturns type=\"Document | ShadowRoot\">\n  The document or shadow root containing the editor.\n</APIReturns>\n</API>\n\n### `findEventRange`\n\nGet the target range from a DOM event.\n\n<API name=\"findEventRange\">\n<APIParameters>\n  <APIItem name=\"event\" type=\"Event\">\n    The DOM event to get the range from.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"TRange | null\">\n  The range at the event target, or null if no valid range found.\n</APIReturns>\n</API>\n\n### `findKey`\n\nFind a key for a Plate node. Returns an instance of `Key` which looks like `{ id: string }`.\n\n<API name=\"findKey\">\n<APIParameters>\n  <APIItem name=\"node\" type=\"TNode\">\n    The node to find the key for.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"Key\">\n  The key associated with the node.\n</APIReturns>\n</API>\n\n### `getWindow`\n\nGet the window object from the editor.\n\n<API name=\"getWindow\">\n<APIReturns type=\"Window\">\n  The window object associated with the editor.\n</APIReturns>\n</API>\n\n### `hasDOMNode`\n\nCheck if a DOM node is within the editor.\n\n<API name=\"hasDOMNode\">\n<APIParameters>\n  <APIItem name=\"target\" type=\"Node\">\n    The DOM node to check.\n  </APIItem>\n  <APIItem name=\"options\" type=\"object\" optional>\n    Options for checking the DOM node.\n  </APIItem>\n</APIParameters>\n<APIOptions type=\"object\">\n  <APIItem name=\"editable\" type=\"boolean\" optional>\n    Whether to check if the node is in an editable element.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"boolean\">\n  True if the DOM node is within the editor, false otherwise.\n</APIReturns>\n</API>\n\n### `hasEditableTarget`\n\nCheck if a DOM target is editable.\n\n<API name=\"hasEditableTarget\">\n<APIParameters>\n  <APIItem name=\"target\" type=\"EventTarget | null\">\n    The DOM target to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"target is Node\">\n  True if the target is editable, false otherwise.\n</APIReturns>\n</API>\n\n### `hasRange`\n\nCheck if the editor has a range.\n\n<API name=\"hasRange\">\n<APIParameters>\n  <APIItem name=\"range\" type=\"TRange\">\n    The range to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the editor has the specified range, false otherwise.\n</APIReturns>\n</API>\n\n### `hasSelectableTarget`\n\nCheck if a DOM target is selectable.\n\n<API name=\"hasSelectableTarget\">\n<APIParameters>\n  <APIItem name=\"target\" type=\"EventTarget | null\">\n    The DOM target to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"target is Node\">\n  True if the target is selectable, false otherwise.\n</APIReturns>\n</API>\n\n### `hasTarget`\n\nCheck if a DOM target exists.\n\n<API name=\"hasTarget\">\n<APIParameters>\n  <APIItem name=\"target\" type=\"EventTarget | null\">\n    The DOM target to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"target is Node\">\n  True if the target exists, false otherwise.\n</APIReturns>\n</API>\n\n### `isComposing`\n\nCheck if the user is currently composing inside the editor.\n\n<API name=\"isComposing\">\n<APIReturns type=\"boolean\">\n  True if the user is currently composing text, false otherwise.\n</APIReturns>\n</API>\n\n### `isFocused`\n\nCheck if the editor is focused.\n\n<API name=\"isFocused\">\n<APIReturns type=\"boolean\">\n  True if the editor has focus, false otherwise.\n</APIReturns>\n</API>\n\n### `isReadOnly`\n\nCheck if the editor is in read-only mode.\n\n<API name=\"isReadOnly\">\n<APIReturns type=\"boolean\">\n  True if the editor is read-only, false otherwise.\n</APIReturns>\n</API>\n\n### `toDOMNode`\n\nFind the native DOM element from a Plate node.\n\n<API name=\"toDOMNode\">\n<APIOptions type=\"TNode\">\n  <APIItem name=\"node\" type=\"TNode\">\n    The Plate node to convert to a DOM element.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"HTMLElement\">\n  The corresponding DOM element for the Plate node.\n</APIReturns>\n</API>\n\n### `toDOMPoint`\n\nFind a native DOM selection point from a Plate point.\n\n<API name=\"toDOMPoint\">\n<APIOptions type=\"Point\">\n  <APIItem name=\"point\" type=\"Point\">\n    The Plate point to convert to a DOM point.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"DOMPoint\">\n  A tuple of [node, offset] representing the DOM point.\n</APIReturns>\n</API>\n\n### `toDOMRange`\n\nFind a native DOM range from a Plate range.\n\n<API name=\"toDOMRange\">\n<APIOptions type=\"TRange\">\n  <APIItem name=\"range\" type=\"TRange\">\n    The Plate range to convert to a DOM range.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"DOMRange\">\n  The corresponding DOM range for the Plate range.\n</APIReturns>\n</API>\n\n### `toSlateNode`\n\nFind a Plate node from a native DOM element.\n\n<API name=\"toSlateNode\">\n<APIOptions type=\"DOMNode\">\n  <APIItem name=\"domNode\" type=\"DOMNode\">\n    The DOM node to convert to a Plate node.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"TNode | undefined\">\n  The corresponding Plate node if found, undefined otherwise.\n</APIReturns>\n</API>\n\n### `toSlatePoint`\n\nFind a Plate point from a DOM selection point.\n\n<API name=\"toSlatePoint\">\n<APIOptions type=\"DOMPoint\">\n  <APIItem name=\"domPoint\" type=\"DOMPoint\">\n    The DOM point to convert to a Plate point.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"Point | undefined\">\n  The corresponding Plate point if found, undefined otherwise.\n</APIReturns>\n</API>\n\n### `toSlateRange`\n\nFind a Plate range from a DOM range.\n\n<API name=\"toSlateRange\">\n<APIOptions type=\"DOMRange\">\n  <APIItem name=\"domRange\" type=\"DOMRange\">\n    The DOM range to convert to a Plate range.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"TRange | undefined\">\n  The corresponding Plate range if found, undefined otherwise.\n</APIReturns>\n</API>\n\n## Callback\n\n### `onChange`\n\nCalled when there is a change in the editor.\n\n<API name=\"onChange\">\n<APIOptions type=\"object\">\n  <APIItem name=\"operation\" type=\"Operation\" optional>\n    The operation that triggered the change.\n  </APIItem>\n</APIOptions>\n</API>\n\n## Core\n\n### `getDirtyPaths`\n\nGet the paths that need to be normalized after an operation.\n\n<API name=\"getDirtyPaths\">\n<APIParameters>\n  <APIItem name=\"operation\" type=\"Operation<N extends DescendantIn<V>>\">\n    The operation that triggered normalization.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"Path[]\">\n  An array of paths that need to be normalized after the operation.\n</APIReturns>\n</API>\n\n### `shouldMergeNodes`\n\nDecide whether two adjacent node entries should merge. Plate calls this before\n`editor.tf.mergeNodes()` applies a merge operation.\n\n<API name=\"shouldMergeNodes\">\n<APIParameters>\n  <APIItem name=\"prevNodeEntry\" type=\"NodeEntry\">\n    Previous node entry at the merge boundary.\n  </APIItem>\n  <APIItem name=\"nextNodeEntry\" type=\"NodeEntry\">\n    Next node entry at the merge boundary.\n  </APIItem>\n  <APIItem name=\"options\" type=\"{ reverse?: boolean }\" optional>\n    Merge direction metadata.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True when the nodes should merge, false when the merge should stop.\n</APIReturns>\n</API>\n\n### `shouldNormalizeNode`\n\nOverride this method to prevent normalizing a specific node. Defaults to returning `true`.\n\n<API name=\"shouldNormalizeNode\">\n<APIParameters>\n  <APIItem name=\"entry\" type=\"NodeEntry\">\n    The node entry (node and path) to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  True if the node should be normalized, false otherwise.\n</APIReturns>\n</API>\n\n### `setNormalizing`\n\nManually control the editor's normalizing state.\n\n<API name=\"setNormalizing\">\n<APIOptions type=\"boolean\">\n  <APIItem name=\"isNormalizing\" type=\"boolean\">\n    Whether the editor should normalize after each operation.\n  </APIItem>\n</APIOptions>\n</API>\n\n### `shouldNormalize`\n\nControls whether the editor should normalize after an operation. Override this method to prevent normalizing in certain situations.\n\n<API name=\"shouldNormalize\">\n<APIOptions type=\"object\">\n  <APIItem name=\"dirtyPaths\" type=\"Path[]\">\n    The paths that need to be normalized.\n  </APIItem>\n  <APIItem name=\"initialDirtyPathsLength\" type=\"number\">\n    The initial number of dirty paths before normalization started.\n  </APIItem>\n  <APIItem name=\"iteration\" type=\"number\">\n    The current normalization iteration count.\n  </APIItem>\n  <APIItem name=\"operation\" type=\"Operation\" optional>\n    The operation that triggered the normalization.\n  </APIItem>\n</APIOptions>\n\n<APIReturns type=\"boolean\">\n  True if the editor should normalize, false otherwise.\n</APIReturns>\n</API>\n\n## History\n\n### `isMerging`\n\nGet the merge flag's current value.\n\n<API name=\"isMerging\">\n<APIReturns type=\"boolean\">\n  True if the editor is currently merging operations, false otherwise.\n</APIReturns>\n</API>\n\n### `isSaving`\n\nGet the saving flag's current value.\n\n<API name=\"isSaving\">\n<APIReturns type=\"boolean\">\n  True if the editor is currently saving, false otherwise.\n</APIReturns>\n</API>\n\n### `isSplittingOnce`\n\nGet the splitting flag's current value.\n\n<API name=\"isSplittingOnce\">\n<APIReturns type=\"boolean\">\n  True if the editor is currently performing a single split operation, false otherwise.\n</APIReturns>\n</API>\n\n## Utils\n\n### `create.block`\n\nDefault block factory for creating new block elements.\n\n<API name=\"create.block\">\n<APIParameters>\n  <APIItem name=\"node\" type=\"Partial<TElement>\" optional>\n    Partial element properties to merge into the new block.\n  </APIItem>\n  <APIItem name=\"path\" type=\"Path\" optional>\n    Path for the new block.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"TElement\">\n  A new block element.\n</APIReturns>\n</API>\n\n### `create.value`\n\nDefault value factory for creating new editor values.\n\n<API name=\"create.value\">\n<APIReturns type=\"Value\">\n  A new editor value.\n</APIReturns>\n</API>\n",
      "type": "registry:file",
      "target": "content/docs/plate/api/slate/editor-api.mdx"
    }
  ],
  "type": "registry:file"
}