import { ApplySchemaAttributes, FindProsemirrorNodeResult, NodeExtensionSpec, NodeSpecOverride, ResolvedPos, SchemaProps, Selection } from '@remirror/core'; import type { Node as ProsemirrorNode } from '@remirror/pm/model'; export interface TableSchemaSpec extends NodeExtensionSpec { tableRole: TableRole; } export interface CreateTableCommand { /** * Defines the number of rows to create with. * * @defaultValue 3 */ rowsCount?: number; /** * Defines the number of columns to create with. * * @defaultValue 3 */ columnsCount?: number; /** * When true the first row of the table will be a header row. * * @defaultValue true */ withHeaderRow?: boolean; /** * Defines the content of each cell as a prosemirror node. * * @defaultValue undefined */ cellContent?: ProsemirrorNode; } export interface CreateTableProps extends SchemaProps, CreateTableCommand { } /** * This function creates the base for the tableNode ProseMirror specs. */ export declare function createTableNodeSchema(extra: ApplySchemaAttributes, override: NodeSpecOverride): Record<'table' | 'tableRow' | 'tableCell' | 'tableHeaderCell', TableSchemaSpec>; declare const TABLE_ROLES: readonly ["table", "row", "cell", "header_cell"]; export type TableRole = (typeof TABLE_ROLES)[number]; /** * Returns a table node of a given size. * * @remarks * * ```ts * const table = createTable({ schema: state.schema }); // 3x3 table node * dispatch(tr.replaceSelectionWith(table).scrollIntoView()); * ``` */ export declare function createTable(props: CreateTableProps): ProsemirrorNode; /** * Finds the nearest parent table node (if it exists) */ export declare function findTable(selection: Selection | ResolvedPos): FindProsemirrorNodeResult | undefined; /** * Finds the nearest parent table cell or header cell (if it exists) */ export declare function findCellClosestToPos(selection: Selection | ResolvedPos): FindProsemirrorNodeResult | undefined; export declare const createTableOptions: Remirror.CommandDecoratorOptions; export {};