Skip to content

Type Editor


Type Editor / @type-editor/tables / utils/cell-near

utils/cell-near

Functions

FunctionDescription

cellNear

Finds a cell near the given position by traversing adjacent nodes.

This function first looks forward through nodeAfter and its first children, then looks backward through nodeBefore and its last children. This is useful when the position is at a table boundary rather than inside a cell.

Example

typescript
const $cell = cellNear($pos);
if ($cell) {
  console.log("Found cell near position");
}