mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-08-06 13:38:49 +08:00
fix: add correct type for parseOptions
This commit is contained in:
parent
b8011dd095
commit
592892edd1
@ -1,4 +1,5 @@
|
||||
import { TextSelection } from 'prosemirror-state'
|
||||
import { ParseOptions } from 'prosemirror-model'
|
||||
import createDocument from '../helpers/createDocument'
|
||||
import { Command, RawCommands, Content } from '../types'
|
||||
|
||||
@ -11,7 +12,7 @@ declare module '@tiptap/core' {
|
||||
setContent: (
|
||||
content: Content,
|
||||
emitUpdate?: boolean,
|
||||
parseOptions?: Record<string, any>,
|
||||
parseOptions?: ParseOptions,
|
||||
) => Command,
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Schema, Node as ProseMirrorNode } from 'prosemirror-model'
|
||||
import { Schema, Node as ProseMirrorNode, ParseOptions } from 'prosemirror-model'
|
||||
import { Content } from '../types'
|
||||
import createNodeFromContent from './createNodeFromContent'
|
||||
|
||||
export default function createDocument(
|
||||
content: Content,
|
||||
schema: Schema,
|
||||
parseOptions: Record<string, any> = {},
|
||||
parseOptions: ParseOptions = {},
|
||||
): ProseMirrorNode {
|
||||
return createNodeFromContent(content, schema, { slice: false, parseOptions }) as ProseMirrorNode
|
||||
}
|
||||
|
@ -3,13 +3,14 @@ import {
|
||||
DOMParser,
|
||||
Node as ProseMirrorNode,
|
||||
Fragment,
|
||||
ParseOptions,
|
||||
} from 'prosemirror-model'
|
||||
import elementFromString from '../utilities/elementFromString'
|
||||
import { Content } from '../types'
|
||||
|
||||
export type CreateNodeFromContentOptions = {
|
||||
slice?: boolean,
|
||||
parseOptions?: Record<string, any>,
|
||||
parseOptions?: ParseOptions,
|
||||
}
|
||||
|
||||
export default function createNodeFromContent(
|
||||
|
Loading…
Reference in New Issue
Block a user