fix some types
This commit is contained in:
@@ -51,10 +51,10 @@ type EditorContent = string | JSON | null
|
|||||||
|
|
||||||
interface EditorOptions {
|
interface EditorOptions {
|
||||||
element: Element,
|
element: Element,
|
||||||
content: EditorContent
|
content: EditorContent,
|
||||||
extensions: (Extension | Node | Mark)[]
|
extensions: (Extension | Node | Mark)[],
|
||||||
injectCSS: Boolean,
|
injectCSS: Boolean,
|
||||||
autoFocus: 'start' | 'end' | number | boolean | null
|
autoFocus: 'start' | 'end' | number | boolean | null,
|
||||||
}
|
}
|
||||||
|
|
||||||
@magicMethods
|
@magicMethods
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Extension } from '@tiptap/core'
|
|||||||
import { Plugin } from 'prosemirror-state'
|
import { Plugin } from 'prosemirror-state'
|
||||||
import { DecorationSet, Decoration } from 'prosemirror-view'
|
import { DecorationSet, Decoration } from 'prosemirror-view'
|
||||||
|
|
||||||
type FocusOptions = {
|
interface FocusOptions {
|
||||||
className: string,
|
className: string,
|
||||||
nested: boolean,
|
nested: boolean,
|
||||||
}
|
}
|
||||||
@@ -11,8 +11,8 @@ export default class Focus extends Extension {
|
|||||||
|
|
||||||
name = 'focus'
|
name = 'focus'
|
||||||
|
|
||||||
constructor(focusOptions: FocusOptions) {
|
constructor(options: Partial<FocusOptions> = {}) {
|
||||||
super(focusOptions)
|
super(options)
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultOptions(): FocusOptions {
|
defaultOptions(): FocusOptions {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { textblockTypeInputRule } from 'prosemirror-inputrules'
|
|||||||
type Level = 1 | 2 | 3 | 4 | 5 | 6
|
type Level = 1 | 2 | 3 | 4 | 5 | 6
|
||||||
|
|
||||||
interface HeadingOptions {
|
interface HeadingOptions {
|
||||||
levels?: Level[],
|
levels: Level[],
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@tiptap/core/src/Editor' {
|
declare module '@tiptap/core/src/Editor' {
|
||||||
@@ -19,6 +19,10 @@ export default class Heading extends Node {
|
|||||||
|
|
||||||
name = 'heading'
|
name = 'heading'
|
||||||
|
|
||||||
|
constructor(options: Partial<HeadingOptions> = {}) {
|
||||||
|
super(options)
|
||||||
|
}
|
||||||
|
|
||||||
defaultOptions(): HeadingOptions {
|
defaultOptions(): HeadingOptions {
|
||||||
return {
|
return {
|
||||||
levels: [1, 2, 3, 4, 5, 6],
|
levels: [1, 2, 3, 4, 5, 6],
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default class History extends Extension {
|
|||||||
|
|
||||||
name = 'history'
|
name = 'history'
|
||||||
|
|
||||||
constructor(options?: HistoryOptions) {
|
constructor(options: Partial<HistoryOptions> = {}) {
|
||||||
super(options)
|
super(options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user