fix: improve types for generateHTML

This commit is contained in:
Philipp Kühn 2021-06-17 23:41:42 +02:00
parent c8375aa294
commit 502b5b1cc9
2 changed files with 4 additions and 4 deletions

View File

@ -1,9 +1,9 @@
import { Node } from 'prosemirror-model'
import getSchema from './getSchema'
import getHTMLFromFragment from './getHTMLFromFragment'
import { Extensions } from '../types'
import { Extensions, JSONContent } from '../types'
export default function generateHTML(doc: object, extensions: Extensions): string {
export default function generateHTML(doc: JSONContent, extensions: Extensions): string {
const schema = getSchema(extensions)
const contentNode = Node.fromJSON(schema, doc)

View File

@ -1,8 +1,8 @@
import { Extensions, getSchema } from '@tiptap/core'
import { Extensions, getSchema, JSONContent } from '@tiptap/core'
import { Node } from 'prosemirror-model'
import getHTMLFromFragment from './getHTMLFromFragment'
export default function generateHTML(doc: object, extensions: Extensions): string {
export default function generateHTML(doc: JSONContent, extensions: Extensions): string {
const schema = getSchema(extensions)
const contentNode = Node.fromJSON(schema, doc)