File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
packages/richtext-lexical/src/features/blocks/nodes Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -14,24 +14,23 @@ import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'
14
14
import ObjectID from 'bson-objectid'
15
15
import React , { type JSX } from 'react'
16
16
17
- export type BlockFields = {
17
+ export type BlockFields < TBlockFields extends object = Record < string , unknown > > = {
18
18
/** Block form data */
19
- [ key : string ] : any
20
19
blockName : string
21
20
blockType : string
22
21
id : string
23
- }
22
+ } & TBlockFields
24
23
25
24
const BlockComponent = React . lazy ( ( ) =>
26
25
import ( '../component/index.js' ) . then ( ( module ) => ( {
27
26
default : module . BlockComponent ,
28
27
} ) ) ,
29
28
)
30
29
31
- export type SerializedBlockNode = Spread <
30
+ export type SerializedBlockNode < TBlockFields extends object = Record < string , unknown > > = Spread <
32
31
{
33
32
children ?: never // required so that our typed editor state doesn't automatically add children
34
- fields : BlockFields
33
+ fields : BlockFields < TBlockFields >
35
34
type : 'block'
36
35
} ,
37
36
SerializedDecoratorBlockNode
You can’t perform that action at this time.
0 commit comments