improve Content type

This commit is contained in:
Philipp Kühn 2021-05-05 13:08:19 +02:00
parent 9ff7e2400e
commit ec838a11f2

View File

@ -60,7 +60,16 @@ export interface EditorOptions {
onDestroy: () => void,
}
export type Content = string | Record<string, any> | null
export type HTMLContent = string
export type JSONContent = {
type: string,
attrs?: Record<string, any>,
content?: JSONContent[],
[key: string]: any,
}
export type Content = HTMLContent | JSONContent | JSONContent[] | null
export type CommandProps = {
editor: Editor,