import { BlockSchema, BlockSchemaFromSpecs, BlockSpecs, CustomBlockNoteSchema, InlineContentSchema, InlineContentSchemaFromSpecs, InlineContentSpecs, StyleSchema, StyleSchemaFromSpecs, StyleSpecs, } from "../schema/index.js"; import { defaultBlockSpecs, defaultInlineContentSpecs, defaultStyleSpecs, } from "./defaultBlocks.js"; export class BlockNoteSchema< BSchema extends BlockSchema, ISchema extends InlineContentSchema, SSchema extends StyleSchema, > extends CustomBlockNoteSchema { public static create< BSpecs extends BlockSpecs | undefined = undefined, ISpecs extends InlineContentSpecs | undefined = undefined, SSpecs extends StyleSpecs | undefined = undefined, >(options?: { /** * A list of custom block types that should be available in the editor. */ blockSpecs?: BSpecs; /** * A list of custom InlineContent types that should be available in the editor. */ inlineContentSpecs?: ISpecs; /** * A list of custom Styles that should be available in the editor. */ styleSpecs?: SSpecs; }): BlockNoteSchema< BSpecs extends undefined ? BlockSchemaFromSpecs : BlockSchemaFromSpecs>, ISpecs extends undefined ? InlineContentSchemaFromSpecs : InlineContentSchemaFromSpecs>, SSpecs extends undefined ? StyleSchemaFromSpecs : StyleSchemaFromSpecs> > { return new BlockNoteSchema({ blockSpecs: options?.blockSpecs ?? defaultBlockSpecs, inlineContentSpecs: options?.inlineContentSpecs ?? defaultInlineContentSpecs, styleSpecs: options?.styleSpecs ?? defaultStyleSpecs, }); } }