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