mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-11 20:08:59 +08:00
chore(extension-table): remove unnecessary @ts-ignore, update view type (#5387)
This commit is contained in:
parent
f7f644f7b2
commit
ce141c2e69
@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
callOrReturn, getExtensionField, mergeAttributes, Node, ParentConfig,
|
callOrReturn, getExtensionField, mergeAttributes, Node, ParentConfig,
|
||||||
} from '@tiptap/core'
|
} from '@tiptap/core'
|
||||||
import { DOMOutputSpec } from '@tiptap/pm/model'
|
import { DOMOutputSpec, Node as ProseMirrorNode } from '@tiptap/pm/model'
|
||||||
import { TextSelection } from '@tiptap/pm/state'
|
import { TextSelection } from '@tiptap/pm/state'
|
||||||
import {
|
import {
|
||||||
addColumnAfter,
|
addColumnAfter,
|
||||||
@ -22,7 +22,7 @@ import {
|
|||||||
toggleHeader,
|
toggleHeader,
|
||||||
toggleHeaderCell,
|
toggleHeaderCell,
|
||||||
} from '@tiptap/pm/tables'
|
} from '@tiptap/pm/tables'
|
||||||
import { NodeView } from '@tiptap/pm/view'
|
import { EditorView, NodeView } from '@tiptap/pm/view'
|
||||||
|
|
||||||
import { TableView } from './TableView.js'
|
import { TableView } from './TableView.js'
|
||||||
import { createColGroup } from './utilities/createColGroup.js'
|
import { createColGroup } from './utilities/createColGroup.js'
|
||||||
@ -62,7 +62,7 @@ export interface TableOptions {
|
|||||||
* The node view to render the table.
|
* The node view to render the table.
|
||||||
* @default TableView
|
* @default TableView
|
||||||
*/
|
*/
|
||||||
View: NodeView
|
View: (new (node: ProseMirrorNode, cellMinWidth: number, view: EditorView) => NodeView) | null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables the resizing of the last column.
|
* Enables the resizing of the last column.
|
||||||
@ -98,7 +98,7 @@ declare module '@tiptap/core' {
|
|||||||
* Add a column before the current column
|
* Add a column before the current column
|
||||||
* @returns True if the command was successful, otherwise false
|
* @returns True if the command was successful, otherwise false
|
||||||
* @example editor.commands.addColumnBefore()
|
* @example editor.commands.addColumnBefore()
|
||||||
*/
|
*/
|
||||||
addColumnBefore: () => ReturnType
|
addColumnBefore: () => ReturnType
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -234,11 +234,11 @@ declare module '@tiptap/core' {
|
|||||||
tableRole?:
|
tableRole?:
|
||||||
| string
|
| string
|
||||||
| ((this: {
|
| ((this: {
|
||||||
name: string
|
name: string
|
||||||
options: Options
|
options: Options
|
||||||
storage: Storage
|
storage: Storage
|
||||||
parent: ParentConfig<NodeConfig<Options>>['tableRole']
|
parent: ParentConfig<NodeConfig<Options>>['tableRole']
|
||||||
}) => string)
|
}) => string)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,10 +431,7 @@ export const Table = Node.create<TableOptions>({
|
|||||||
columnResizing({
|
columnResizing({
|
||||||
handleWidth: this.options.handleWidth,
|
handleWidth: this.options.handleWidth,
|
||||||
cellMinWidth: this.options.cellMinWidth,
|
cellMinWidth: this.options.cellMinWidth,
|
||||||
// @ts-ignore (incorrect type)
|
|
||||||
View: this.options.View,
|
View: this.options.View,
|
||||||
// TODO: PR for @types/prosemirror-tables
|
|
||||||
// @ts-ignore (incorrect type)
|
|
||||||
lastColumnResizable: this.options.lastColumnResizable,
|
lastColumnResizable: this.options.lastColumnResizable,
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user