BlockSuite API Documentation / @blocksuite/store / defineBlockSchema
Function: defineBlockSchema()
defineBlockSchema<
Flavour,Role,Props,Metadata,Model,Transformer>(options):object
Defined in: packages/framework/store/src/model/block/zod.ts:54
Type Parameters
Flavour
Flavour extends string
Role
Role extends "root" | "hub" | "content"
Props
Props extends object
Metadata
Metadata extends Readonly<{ children: string[]; isFlatData: boolean; parent: string[]; role: Role; version: number; }>
Model
Model extends BlockModel<Props>
Transformer
Transformer extends BaseBlockTransformer<Props>
Parameters
options
flavour
Flavour
metadata
Metadata
props?
(internalPrimitives) => Props
toModel?
() => Model
transformer?
(transformerConfig) => Transformer
Returns
object
model
model:
object&Metadata
Type declaration
flavour
flavour:
Flavour
props
props:
PropsGetter<Props>
transformer()?
optionaltransformer: (transformerConfig) =>Transformer
Parameters
transformerConfig
Map<string, unknown>
Returns
Transformer
version
version:
number