import { Block, SylApi, SylController, SylPlugin } from '@syllepsis/adapter'; import { DOMOutputSpec } from 'prosemirror-model'; import { EditorState } from 'prosemirror-state'; import { EditorView } from 'prosemirror-view'; import { IMenuConfig } from './component/menu-button'; import { ITableProps } from './const'; declare module '@syllepsis/adapter' { interface ISylApiCommand { table?: { insert: (row: number, column: number) => boolean; cut: () => boolean; copy: () => boolean; mergeCells: () => boolean; splitCells: () => boolean; addRowBefore: () => boolean; addRowAfter: () => boolean; addColumnBefore: () => boolean; addColumnAfter: () => boolean; deleteRow: () => boolean; deleteColumn: () => boolean; deleteTable: () => boolean; canSplitCell: () => boolean; goPrevCell: () => boolean; goNextCell: () => boolean; }; } } interface ITableItemProps extends IMenuConfig, ITableProps { } declare class TableItem extends Block { name: string; content: string; tableRole: string; isolating: boolean; notLastLine: boolean; group: string; parseDOM: { tag: string; }[]; toDOM: () => DOMOutputSpec; } declare class TableItemController extends SylController { name: string; private menuBtn; private $menu; constructor(editor: SylApi, props: ITableItemProps); insertTable: ({ row, column }: { row: number; column: number; }) => boolean; command: { insert: (editor: SylApi, row: number, column: number) => boolean; cut: (editor: SylApi) => boolean | undefined; copy: (editor: SylApi) => boolean; mergeCells: (editor: SylApi) => boolean; splitCells: (editor: SylApi) => boolean; addRowBefore: (editor: SylApi) => boolean; addRowAfter: (editor: SylApi) => boolean; addColumnBefore: (editor: SylApi) => boolean; addColumnAfter: (editor: SylApi) => boolean; deleteRow: (editor: SylApi) => boolean; deleteColumn: (editor: SylApi) => boolean; deleteTable: (editor: SylApi) => boolean; canSplitCell: (editor: SylApi) => boolean; goPrevCell: (editor: SylApi) => boolean; goNextCell: (editor: SylApi) => boolean; }; keymap: { Tab: (editor: SylApi) => boolean; 'Shift-Tab': (editor: SylApi) => boolean; Backspace: (editor: SylApi, state: EditorState, dispatch: EditorView['dispatch']) => boolean; }; toolbar: { name: string; tooltip: string; getRef: (dom: HTMLElement) => void; handler: (editor: SylApi) => void; }; editorWillUnmount(): void; disable: (editor: SylApi) => boolean; } declare class TableItemPlugin extends SylPlugin { Controller: typeof TableItemController; Schema: typeof TableItem; } export { TableItem, TableItemController, TableItemPlugin };