Skip to content

Type Editor


Type Editor / @type-editor/tables / schema / tableNodeTypes

Function: tableNodeTypes()

ts
function tableNodeTypes(schema): Record<TableRole, NodeType>;

Defined in: tables/src/schema.ts:389

Retrieves the table-related node types from a schema.

This function returns a mapping from table roles to their corresponding NodeType objects. Results are cached on the schema for performance.

Parameters

ParameterTypeDescription
schemaSchemaThe ProseMirror schema to extract node types from.

Returns

Record<TableRole, NodeType>

A record mapping table roles to their NodeType objects.

Example

typescript
const types = tableNodeTypes(schema);
const cellType = types.cell;
const headerType = types.header_cell;