Skip to main content

Module: @lexical/table

Classes

Type Aliases

Cell

Ƭ Cell: Object

Type declaration

NameType
elemHTMLElement
hasBackgroundColorboolean
highlightedboolean
xnumber
ynumber

Defined in

lexical-table/src/LexicalTableSelection.ts:42


GridSelectionShape

Ƭ GridSelectionShape: Object

Type declaration

NameType
fromXnumber
fromYnumber
toXnumber
toYnumber

Defined in

lexical-table/src/LexicalGridSelection.ts:30


HTMLTableElementWithWithTableSelectionState

Ƭ HTMLTableElementWithWithTableSelectionState: HTMLTableElement & Record<typeof LEXICAL_ELEMENT_KEY, TableSelection>

Defined in

lexical-table/src/LexicalTableSelectionHelpers.ts:694


InsertTableCommandPayload

Ƭ InsertTableCommandPayload: Readonly<{ columns: string ; includeHeaders?: InsertTableCommandPayloadHeaders ; rows: string }>

Defined in

lexical-table/src/index.ts:69


InsertTableCommandPayloadHeaders

Ƭ InsertTableCommandPayloadHeaders: Readonly<{ columns: boolean ; rows: boolean }> | boolean

Defined in

lexical-table/src/index.ts:62


SerializedTableCellNode

Ƭ SerializedTableCellNode: Spread<{ backgroundColor?: null | string ; headerState: TableCellHeaderState ; width?: number }, SerializedGridCellNode>

Defined in

lexical-table/src/LexicalTableCellNode.ts:42


SerializedTableNode

Ƭ SerializedTableNode: SerializedElementNode

Defined in

lexical-table/src/LexicalTableNode.ts:33


SerializedTableRowNode

Ƭ SerializedTableRowNode: Spread<{ height: number }, SerializedElementNode>

Defined in

lexical-table/src/LexicalTableRowNode.ts:25

Variables

INSERT_TABLE_COMMAND

Const INSERT_TABLE_COMMAND: LexicalCommand<InsertTableCommandPayload>

Defined in

lexical-table/src/index.ts:75


TableCellHeaderStates

Const TableCellHeaderStates: Object

Type declaration

NameType
BOTHnumber
COLUMNnumber
NO_STATUSnumber
ROWnumber

Defined in

lexical-table/src/LexicalTableCellNode.ts:32

Functions

$createGridSelection

$createGridSelection(): GridSelection

Returns

GridSelection

Defined in

lexical-table/src/LexicalGridSelection.ts:326


$createTableCellNode

$createTableCellNode(headerState, colSpan?, width?): TableCellNode

Parameters

NameTypeDefault value
headerStatenumberundefined
colSpannumber1
width?numberundefined

Returns

TableCellNode

Defined in

lexical-table/src/LexicalTableCellNode.ts:310


$createTableNode

$createTableNode(): TableNode

Returns

TableNode

Defined in

lexical-table/src/LexicalTableNode.ts:238


$createTableNodeWithDimensions

$createTableNodeWithDimensions(rowCount, columnCount, includeHeaders?): TableNode

Parameters

NameTypeDefault value
rowCountnumberundefined
columnCountnumberundefined
includeHeadersInsertTableCommandPayloadHeaderstrue

Returns

TableNode

Defined in

lexical-table/src/LexicalTableUtils.ts:40


$createTableRowNode

$createTableRowNode(height?): TableRowNode

Parameters

NameType
height?number

Returns

TableRowNode

Defined in

lexical-table/src/LexicalTableRowNode.ts:121


$deleteTableColumn

$deleteTableColumn(tableNode, targetIndex): TableNode

Parameters

NameType
tableNodeTableNode
targetIndexnumber

Returns

TableNode

Defined in

lexical-table/src/LexicalTableUtils.ts:421


$deleteTableColumn__EXPERIMENTAL

$deleteTableColumn__EXPERIMENTAL(): void

Returns

void

Defined in

lexical-table/src/LexicalTableUtils.ts:520


$deleteTableRow__EXPERIMENTAL

$deleteTableRow__EXPERIMENTAL(): void

Returns

void

Defined in

lexical-table/src/LexicalTableUtils.ts:444


$getElementGridForTableNode

$getElementGridForTableNode(editor, tableNode): Grid

Parameters

NameType
editorLexicalEditor
tableNodeTableNode

Returns

Grid

Defined in

lexical-table/src/LexicalTableNode.ts:221


$getTableCellNodeFromLexicalNode

$getTableCellNodeFromLexicalNode(startingNode): TableCellNode | null

Parameters

NameType
startingNodeLexicalNode

Returns

TableCellNode | null

Defined in

lexical-table/src/LexicalTableUtils.ts:76


$getTableColumnIndexFromTableCellNode

$getTableColumnIndexFromTableCellNode(tableCellNode): number

Parameters

NameType
tableCellNodeTableCellNode

Returns

number

Defined in

lexical-table/src/LexicalTableUtils.ts:120


$getTableNodeFromLexicalNodeOrThrow

$getTableNodeFromLexicalNodeOrThrow(startingNode): TableNode

Parameters

NameType
startingNodeLexicalNode

Returns

TableNode

Defined in

lexical-table/src/LexicalTableUtils.ts:100


$getTableRowIndexFromTableCellNode

$getTableRowIndexFromTableCellNode(tableCellNode): number

Parameters

NameType
tableCellNodeTableCellNode

Returns

number

Defined in

lexical-table/src/LexicalTableUtils.ts:112


$getTableRowNodeFromTableCellNodeOrThrow

$getTableRowNodeFromTableCellNodeOrThrow(startingNode): TableRowNode

Parameters

NameType
startingNodeLexicalNode

Returns

TableRowNode

Defined in

lexical-table/src/LexicalTableUtils.ts:88


$insertTableColumn

$insertTableColumn(tableNode, targetIndex, shouldInsertAfter?, columnCount, grid): TableNode

Parameters

NameTypeDefault value
tableNodeTableNodeundefined
targetIndexnumberundefined
shouldInsertAfterbooleantrue
columnCountnumberundefined
gridGridundefined

Returns

TableNode

Defined in

lexical-table/src/LexicalTableUtils.ts:283


$insertTableColumn__EXPERIMENTAL

$insertTableColumn__EXPERIMENTAL(insertAfter?): void

Parameters

NameTypeDefault value
insertAfterbooleantrue

Returns

void

Defined in

lexical-table/src/LexicalTableUtils.ts:342


$insertTableRow

$insertTableRow(tableNode, targetIndex, shouldInsertAfter?, rowCount, grid): TableNode

Parameters

NameTypeDefault value
tableNodeTableNodeundefined
targetIndexnumberundefined
shouldInsertAfterbooleantrue
rowCountnumberundefined
gridGridundefined

Returns

TableNode

Defined in

lexical-table/src/LexicalTableUtils.ts:163


$insertTableRow__EXPERIMENTAL

$insertTableRow__EXPERIMENTAL(insertAfter?): void

Parameters

NameTypeDefault value
insertAfterbooleantrue

Returns

void

Defined in

lexical-table/src/LexicalTableUtils.ts:230


$isGridSelection

$isGridSelection(x): x is GridSelection

Parameters

NameType
xunknown

Returns

x is GridSelection

Defined in

lexical-table/src/LexicalGridSelection.ts:322


$isTableCellNode

$isTableCellNode(node): node is TableCellNode

Parameters

NameType
nodeundefined | null | LexicalNode

Returns

node is TableCellNode

Defined in

lexical-table/src/LexicalTableCellNode.ts:318


$isTableNode

$isTableNode(node): node is TableNode

Parameters

NameType
nodeundefined | null | LexicalNode

Returns

node is TableNode

Defined in

lexical-table/src/LexicalTableNode.ts:242


$isTableRowNode

$isTableRowNode(node): node is TableRowNode

Parameters

NameType
nodeundefined | null | LexicalNode

Returns

node is TableRowNode

Defined in

lexical-table/src/LexicalTableRowNode.ts:125


$removeTableRowAtIndex

$removeTableRowAtIndex(tableNode, indexToDelete): TableNode

Parameters

NameType
tableNodeTableNode
indexToDeletenumber

Returns

TableNode

Defined in

lexical-table/src/LexicalTableUtils.ts:148


$unmergeCell

$unmergeCell(): void

Returns

void

Defined in

lexical-table/src/LexicalTableUtils.ts:605


applyTableHandlers

applyTableHandlers(tableNode, tableElement, editor, hasTabHandler): TableSelection

Parameters

NameType
tableNodeTableNode
tableElementHTMLTableElementWithWithTableSelectionState
editorLexicalEditor
hasTabHandlerboolean

Returns

TableSelection

Defined in

lexical-table/src/LexicalTableSelectionHelpers.ts:65


getCellFromTarget

getCellFromTarget(node): Cell | null

Parameters

NameType
nodeNode

Returns

Cell | null

Defined in

lexical-table/src/LexicalTableSelectionHelpers.ts:710


getTableSelectionFromTableElement

getTableSelectionFromTableElement(tableElement): TableSelection | null

Parameters

NameType
tableElementHTMLTableElementWithWithTableSelectionState

Returns

TableSelection | null

Defined in

lexical-table/src/LexicalTableSelectionHelpers.ts:704