@@ -22,9 +22,9 @@ export class BlockNoteSchema<
2222 SSchema extends StyleSchema ,
2323> extends CustomBlockNoteSchema < BSchema , ISchema , SSchema > {
2424 public static create <
25- BSpecs extends BlockSpecs = typeof defaultBlockSpecs ,
26- ISpecs extends InlineContentSpecs = typeof defaultInlineContentSpecs ,
27- SSpecs extends StyleSpecs = typeof defaultStyleSpecs ,
25+ BSpecs extends BlockSpecs | undefined = undefined ,
26+ ISpecs extends InlineContentSpecs | undefined = undefined ,
27+ SSpecs extends StyleSpecs | undefined = undefined ,
2828 > ( options ?: {
2929 /**
3030 * A list of custom block types that should be available in the editor.
@@ -38,12 +38,18 @@ export class BlockNoteSchema<
3838 * A list of custom Styles that should be available in the editor.
3939 */
4040 styleSpecs ?: SSpecs ;
41- } ) {
42- return new BlockNoteSchema <
43- BlockSchemaFromSpecs < BSpecs > ,
44- InlineContentSchemaFromSpecs < ISpecs > ,
45- StyleSchemaFromSpecs < SSpecs >
46- > ( {
41+ } ) : BlockNoteSchema <
42+ BSpecs extends undefined
43+ ? BlockSchemaFromSpecs < typeof defaultBlockSpecs >
44+ : BlockSchemaFromSpecs < NonNullable < BSpecs > > ,
45+ ISpecs extends undefined
46+ ? InlineContentSchemaFromSpecs < typeof defaultInlineContentSpecs >
47+ : InlineContentSchemaFromSpecs < NonNullable < ISpecs > > ,
48+ SSpecs extends undefined
49+ ? StyleSchemaFromSpecs < typeof defaultStyleSpecs >
50+ : StyleSchemaFromSpecs < NonNullable < SSpecs > >
51+ > {
52+ return new BlockNoteSchema < any , any , any > ( {
4753 blockSpecs : options ?. blockSpecs ?? defaultBlockSpecs ,
4854 inlineContentSpecs :
4955 options ?. inlineContentSpecs ?? defaultInlineContentSpecs ,
0 commit comments