add command scope

This commit is contained in:
Philipp Kühn
2021-02-16 11:27:58 +01:00
parent 87beee25b0
commit ca8d1a4245
74 changed files with 614 additions and 460 deletions

View File

@@ -42,25 +42,27 @@ export interface TableOptions {
}
declare module '@tiptap/core' {
interface Commands {
insertTable: (options?: { rows?: number, cols?: number, withHeaderRow?: boolean }) => Command,
addColumnBefore: () => Command,
addColumnAfter: () => Command,
deleteColumn: () => Command,
addRowBefore: () => Command,
addRowAfter: () => Command,
deleteRow: () => Command,
deleteTable: () => Command,
mergeCells: () => Command,
splitCell: () => Command,
toggleHeaderColumn: () => Command,
toggleHeaderRow: () => Command,
toggleHeaderCell: () => Command,
mergeOrSplit: () => Command,
setCellAttribute: (name: string, value: any) => Command,
goToNextCell: () => Command,
goToPreviousCell: () => Command,
fixTables: () => Command,
interface AllCommands {
table: {
insertTable: (options?: { rows?: number, cols?: number, withHeaderRow?: boolean }) => Command,
addColumnBefore: () => Command,
addColumnAfter: () => Command,
deleteColumn: () => Command,
addRowBefore: () => Command,
addRowAfter: () => Command,
deleteRow: () => Command,
deleteTable: () => Command,
mergeCells: () => Command,
splitCell: () => Command,
toggleHeaderColumn: () => Command,
toggleHeaderRow: () => Command,
toggleHeaderCell: () => Command,
mergeOrSplit: () => Command,
setCellAttribute: (name: string, value: any) => Command,
goToNextCell: () => Command,
goToPreviousCell: () => Command,
fixTables: () => Command,
}
}
}