refactoring
This commit is contained in:
@@ -13,7 +13,7 @@ import ExtensionManager from './ExtensionManager'
|
||||
import EventEmitter from './EventEmitter'
|
||||
import {
|
||||
EditorOptions,
|
||||
EditorContent,
|
||||
Content,
|
||||
CanCommands,
|
||||
ChainedCommands,
|
||||
SingleCommands,
|
||||
@@ -237,7 +237,7 @@ export class Editor extends EventEmitter {
|
||||
/**
|
||||
* Creates a ProseMirror document.
|
||||
*/
|
||||
public createDocument = (content: EditorContent, parseOptions = this.options.parseOptions): Node => {
|
||||
public createDocument = (content: Content, parseOptions = this.options.parseOptions): Node => {
|
||||
if (content && typeof content === 'object') {
|
||||
try {
|
||||
return this.schema.nodeFromJSON(content)
|
||||
|
||||
@@ -32,7 +32,7 @@ export type Extensions = (Extension | Node | Mark)[]
|
||||
|
||||
export interface EditorOptions {
|
||||
element: Element,
|
||||
content: EditorContent,
|
||||
content: Content,
|
||||
extensions: Extensions,
|
||||
injectCSS: boolean,
|
||||
autofocus: FocusPosition,
|
||||
@@ -50,7 +50,7 @@ export interface EditorOptions {
|
||||
onDestroy: () => void,
|
||||
}
|
||||
|
||||
export type EditorContent = string | JSON | null
|
||||
export type Content = string | JSON | null
|
||||
|
||||
export type CommandProps = {
|
||||
editor: Editor,
|
||||
|
||||
Reference in New Issue
Block a user