fix: add correct type for parseOptions
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { TextSelection } from 'prosemirror-state'
|
import { TextSelection } from 'prosemirror-state'
|
||||||
|
import { ParseOptions } from 'prosemirror-model'
|
||||||
import createDocument from '../helpers/createDocument'
|
import createDocument from '../helpers/createDocument'
|
||||||
import { Command, RawCommands, Content } from '../types'
|
import { Command, RawCommands, Content } from '../types'
|
||||||
|
|
||||||
@@ -11,7 +12,7 @@ declare module '@tiptap/core' {
|
|||||||
setContent: (
|
setContent: (
|
||||||
content: Content,
|
content: Content,
|
||||||
emitUpdate?: boolean,
|
emitUpdate?: boolean,
|
||||||
parseOptions?: Record<string, any>,
|
parseOptions?: ParseOptions,
|
||||||
) => Command,
|
) => 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 { Content } from '../types'
|
||||||
import createNodeFromContent from './createNodeFromContent'
|
import createNodeFromContent from './createNodeFromContent'
|
||||||
|
|
||||||
export default function createDocument(
|
export default function createDocument(
|
||||||
content: Content,
|
content: Content,
|
||||||
schema: Schema,
|
schema: Schema,
|
||||||
parseOptions: Record<string, any> = {},
|
parseOptions: ParseOptions = {},
|
||||||
): ProseMirrorNode {
|
): ProseMirrorNode {
|
||||||
return createNodeFromContent(content, schema, { slice: false, parseOptions }) as ProseMirrorNode
|
return createNodeFromContent(content, schema, { slice: false, parseOptions }) as ProseMirrorNode
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,14 @@ import {
|
|||||||
DOMParser,
|
DOMParser,
|
||||||
Node as ProseMirrorNode,
|
Node as ProseMirrorNode,
|
||||||
Fragment,
|
Fragment,
|
||||||
|
ParseOptions,
|
||||||
} from 'prosemirror-model'
|
} from 'prosemirror-model'
|
||||||
import elementFromString from '../utilities/elementFromString'
|
import elementFromString from '../utilities/elementFromString'
|
||||||
import { Content } from '../types'
|
import { Content } from '../types'
|
||||||
|
|
||||||
export type CreateNodeFromContentOptions = {
|
export type CreateNodeFromContentOptions = {
|
||||||
slice?: boolean,
|
slice?: boolean,
|
||||||
parseOptions?: Record<string, any>,
|
parseOptions?: ParseOptions,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function createNodeFromContent(
|
export default function createNodeFromContent(
|
||||||
|
|||||||
Reference in New Issue
Block a user