]> BookStack Code Mirror - bookstack/blob - resources/js/wysiwyg/lexical/table/LexicalTableCommands.ts
Lexical: Imported core lexical libs
[bookstack] / resources / js / wysiwyg / lexical / table / LexicalTableCommands.ts
1 /**
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  *
7  */
8
9 import type {LexicalCommand} from 'lexical';
10
11 import {createCommand} from 'lexical';
12
13 export type InsertTableCommandPayloadHeaders =
14   | Readonly<{
15       rows: boolean;
16       columns: boolean;
17     }>
18   | boolean;
19
20 export type InsertTableCommandPayload = Readonly<{
21   columns: string;
22   rows: string;
23   includeHeaders?: InsertTableCommandPayloadHeaders;
24 }>;
25
26 export const INSERT_TABLE_COMMAND: LexicalCommand<InsertTableCommandPayload> =
27   createCommand('INSERT_TABLE_COMMAND');