refactoring

This commit is contained in:
Philipp Kühn
2021-02-28 00:02:51 +01:00
parent 015c47707a
commit 4721fe451f
4 changed files with 7 additions and 24 deletions

View File

@@ -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)

View File

@@ -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,