prosekit/extensions/table
Interfaces
Section titled “Interfaces”InsertTableOptions
Section titled “InsertTableOptions”Properties
Section titled “Properties”-
row:number -
The number of rows in the table.
-
col:number -
The number of columns in the table.
-
header?:boolean -
Whether the table has a header row.
Default
Section titled “Default”false
SelectTableCellOptions
Section titled “SelectTableCellOptions”Properties
Section titled “Properties”-
pos?:number -
A hit position of the table cell to select from. By default, the selection anchor will be used.
SelectTableColumnOptions
Section titled “SelectTableColumnOptions”Properties
Section titled “Properties”-
anchor?:number -
A hit position of the table cell to select from. By default, the selection anchor will be used.
-
head?:number -
A hit position of the table cell to select to. By default, the selection head will be used.
SelectTableRowOptions
Section titled “SelectTableRowOptions”Properties
Section titled “Properties”-
anchor?:number -
A hit position of the table cell to select from. By default, the selection anchor will be used.
-
head?:number -
A hit position of the table cell to select to. By default, the selection head will be used.
SelectTableOptions
Section titled “SelectTableOptions”Properties
Section titled “Properties”-
pos?:number -
A hit position of the table to select from. By default, the selection anchor will be used.
MoveTableRowOptions
Section titled “MoveTableRowOptions”Options for moveTableRow
Properties
Section titled “Properties”-
from:number -
The source row index to move from.
-
to:number -
The destination row index to move to.
-
select?:boolean -
Whether to select the moved row after the operation.
Default
Section titled “Default”true
-
pos?:number -
Optional position to resolve table from. If not provided, uses the current selection.
MoveTableColumnOptions
Section titled “MoveTableColumnOptions”Options for moveTableColumn
Properties
Section titled “Properties”-
from:number -
The source column index to move from.
-
to:number -
The destination column index to move to.
-
select?:boolean -
Whether to select the moved column after the operation.
Default
Section titled “Default”true
-
pos?:number -
Optional position to resolve table from. If not provided, uses the current selection.
Variables
Section titled “Variables”exitTable
Section titled “exitTable”-
When the selection is in a table node, create a default block after the table table, and move the cursor there.
Functions
Section titled “Functions”defineTableCommands()
Section titled “defineTableCommands()”-
function defineTableCommands():TableCommandsExtension -
Adds commands for working with
tablenodes.
insertTable()
Section titled “insertTable()”-
function insertTable(options:InsertTableOptions):Command -
Insert a table node with the given number of rows and columns, and optionally a header row.
selectTableCell()
Section titled “selectTableCell()”-
function selectTableCell(options?:SelectTableCellOptions):Command
selectTableColumn()
Section titled “selectTableColumn()”-
function selectTableColumn(options?:SelectTableColumnOptions):Command
selectTableRow()
Section titled “selectTableRow()”-
function selectTableRow(options?:SelectTableRowOptions):Command
selectTable()
Section titled “selectTable()”-
function selectTable(options?:SelectTableOptions):Command
defineTablePlugins()
Section titled “defineTablePlugins()”-
function defineTablePlugins():PlainExtension
defineTableHeaderCellSpec()
Section titled “defineTableHeaderCellSpec()”-
function defineTableHeaderCellSpec():TableHeaderCellSpecExtension
isCellSelection()
Section titled “isCellSelection()”-
function isCellSelection(value:unknown):value is CellSelection -
Checks if the given object is a
CellSelectioninstance.
defineTable()
Section titled “defineTable()”-
function defineTable():TableExtension
moveTableRow()
Section titled “moveTableRow()”-
function moveTableRow(options:MoveTableRowOptions):Command -
Move a table row from index
fromto indexto.
moveTableColumn()
Section titled “moveTableColumn()”-
function moveTableColumn(options:MoveTableColumnOptions):Command -
Move a table column from index
fromto indexto.
findTable()
Section titled “findTable()”-
function findTable($pos:ResolvedPos):FindNodeResult|null -
Find the closest table node for a given position.