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
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.
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.
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.
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.
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.
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”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.
selectTableColumn()
Section titled “selectTableColumn()”-
function selectTableColumn(
options?
:SelectTableColumnOptions
):Command
selectTableRow()
Section titled “selectTableRow()”-
function selectTableRow(
options?
:SelectTableRowOptions
):Command
selectTableCell()
Section titled “selectTableCell()”-
function selectTableCell(
options?
:SelectTableCellOptions
):Command
selectTable()
Section titled “selectTable()”-
function selectTable(
options?
:SelectTableOptions
):Command
defineTableCommands()
Section titled “defineTableCommands()”-
function defineTableCommands():
TableCommandsExtension
-
Adds commands for working with
table
nodes.
moveTableColumn()
Section titled “moveTableColumn()”-
function moveTableColumn(
options
:MoveTableColumnOptions
):Command
-
Move a table column from index
origin
to indextarget
.
moveTableRow()
Section titled “moveTableRow()”-
function moveTableRow(
options
:MoveTableRowOptions
):Command
-
Move a table row from index
origin
to indextarget
.
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
CellSelection
instance.
defineTable()
Section titled “defineTable()”-
function defineTable():
TableExtension