Skip to content

Commit

Permalink
fix: ensure defaultConverters type is compatible with whatever generi…
Browse files Browse the repository at this point in the history
…c the user may pass (assuming it includes DefaultNodeTypes - otherwise, defaultConverters shouldn't be spread anyways)
  • Loading branch information
AlessioGr committed Nov 27, 2024
1 parent 363a3ec commit 451666e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { DefaultNodeTypes } from '../../../../../nodeTypes.js'
import type { JSXConverters } from './types.js'

import { BlockquoteJSXConverter } from './converters/blockquote.js'
Expand All @@ -11,7 +12,7 @@ import { TableJSXConverter } from './converters/table.js'
import { TextJSXConverter } from './converters/text.js'
import { UploadJSXConverter } from './converters/upload.js'

export const defaultJSXConverters: JSXConverters = {
export const defaultJSXConverters: JSXConverters<DefaultNodeTypes> = {
...ParagraphJSXConverter,
...TextJSXConverter,
...LinebreakJSXConverter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type JSXConvertersFunction<
| DefaultNodeTypes
| SerializedBlockNode<{ blockName?: null | string; blockType: string }>
| SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>,
> = (args: { defaultConverters: JSXConverters }) => JSXConverters<T>
> = (args: { defaultConverters: JSXConverters<DefaultNodeTypes> }) => JSXConverters<T>

type Props = {
className?: string
Expand Down

0 comments on commit 451666e

Please sign in to comment.