mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 14:59:27 +08:00
fix some types
This commit is contained in:
parent
aa557af648
commit
34b8f18a57
@ -29,11 +29,11 @@ export interface CommandSpec {
|
||||
|
||||
type EditorContent = string | JSON | null
|
||||
|
||||
interface Options {
|
||||
element?: HTMLElement,
|
||||
content?: EditorContent
|
||||
extensions?: (Extension | Node | Mark)[]
|
||||
injectCSS?: Boolean
|
||||
interface EditorOptions {
|
||||
element: HTMLElement,
|
||||
content: EditorContent
|
||||
extensions: (Extension | Node | Mark)[]
|
||||
injectCSS: Boolean,
|
||||
}
|
||||
|
||||
@magicMethods
|
||||
@ -43,24 +43,24 @@ export class Editor extends EventEmitter {
|
||||
extensionManager!: ExtensionManager
|
||||
schema!: Schema
|
||||
view!: EditorView
|
||||
options: Options = {
|
||||
commands: { [key: string]: any } = {}
|
||||
css!: HTMLStyleElement
|
||||
options: EditorOptions = {
|
||||
element: document.createElement('div'),
|
||||
content: '',
|
||||
injectCSS: true,
|
||||
extensions: [],
|
||||
}
|
||||
commands: { [key: string]: any } = {}
|
||||
css!: HTMLStyleElement
|
||||
|
||||
private lastCommand = Promise.resolve()
|
||||
|
||||
public selection = { from: 0, to: 0 }
|
||||
|
||||
constructor(options: Options) {
|
||||
constructor(options: Partial<EditorOptions> = {}) {
|
||||
super()
|
||||
this.options = { ...this.options, ...options }
|
||||
}
|
||||
|
||||
|
||||
private init() {
|
||||
this.createExtensionManager()
|
||||
this.createSchema()
|
||||
|
@ -11,11 +11,8 @@
|
||||
"experimentalDecorators": true,
|
||||
"sourceMap": true,
|
||||
"baseUrl": ".",
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"allowJs": false,
|
||||
"checkJs": false,
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"packages/*"
|
||||
|
Loading…
Reference in New Issue
Block a user