diff --git a/packages/core/src/Editor.ts b/packages/core/src/Editor.ts index 3bbc7260..e35aa46e 100644 --- a/packages/core/src/Editor.ts +++ b/packages/core/src/Editor.ts @@ -51,10 +51,10 @@ type EditorContent = string | JSON | null interface EditorOptions { element: Element, - content: EditorContent - extensions: (Extension | Node | Mark)[] + content: EditorContent, + extensions: (Extension | Node | Mark)[], injectCSS: Boolean, - autoFocus: 'start' | 'end' | number | boolean | null + autoFocus: 'start' | 'end' | number | boolean | null, } @magicMethods diff --git a/packages/extension-focus/index.ts b/packages/extension-focus/index.ts index ee5ec51f..806464d9 100644 --- a/packages/extension-focus/index.ts +++ b/packages/extension-focus/index.ts @@ -2,7 +2,7 @@ import { Extension } from '@tiptap/core' import { Plugin } from 'prosemirror-state' import { DecorationSet, Decoration } from 'prosemirror-view' -type FocusOptions = { +interface FocusOptions { className: string, nested: boolean, } @@ -11,8 +11,8 @@ export default class Focus extends Extension { name = 'focus' - constructor(focusOptions: FocusOptions) { - super(focusOptions) + constructor(options: Partial = {}) { + super(options) } defaultOptions(): FocusOptions { diff --git a/packages/extension-heading/index.ts b/packages/extension-heading/index.ts index c8d72ea1..72b631e9 100644 --- a/packages/extension-heading/index.ts +++ b/packages/extension-heading/index.ts @@ -6,7 +6,7 @@ import { textblockTypeInputRule } from 'prosemirror-inputrules' type Level = 1 | 2 | 3 | 4 | 5 | 6 interface HeadingOptions { - levels?: Level[], + levels: Level[], } declare module '@tiptap/core/src/Editor' { @@ -19,6 +19,10 @@ export default class Heading extends Node { name = 'heading' + constructor(options: Partial = {}) { + super(options) + } + defaultOptions(): HeadingOptions { return { levels: [1, 2, 3, 4, 5, 6], diff --git a/packages/extension-history/index.ts b/packages/extension-history/index.ts index 911e0e1f..2bc3ac75 100644 --- a/packages/extension-history/index.ts +++ b/packages/extension-history/index.ts @@ -22,7 +22,7 @@ export default class History extends Extension { name = 'history' - constructor(options?: HistoryOptions) { + constructor(options: Partial = {}) { super(options) }