Skip to content

Type Editor


Type Editor / @type-editor/tables / utils/points-at-cell / pointsAtCell

Function: pointsAtCell()

ts
function pointsAtCell($pos): boolean;

Defined in: tables/src/utils/points-at-cell.ts:20

Checks if the given position points directly at a cell.

A position "points at" a cell when its parent is a table row and there is a node immediately after the position.

Parameters

ParameterTypeDescription
$posResolvedPosThe resolved position to check.

Returns

boolean

True if the position points at a cell, false otherwise.

Example

typescript
if (pointsAtCell($pos)) {
  const cell = $pos.nodeAfter;
  // Process the cell...
}