Skip to content

BlockSuite API Documentation / @blocksuite/store / defineBlockSchema

Function: defineBlockSchema()

defineBlockSchema<Flavour, Role, Props, Metadata, Model, Transformer>(options): object

Type Parameters

Flavour extends string

Role extends "root" | "hub" | "content"

Props extends object

Metadata extends Readonly<{ children: string[]; parent: string[]; role: Role; version: number; }>

Model extends BlockModel<Props, SignaledProps<Props>>

Transformer extends BaseBlockTransformer<Props>

Parameters

options

flavour

Flavour

metadata

Metadata

props

(internalPrimitives) => Props

toModel

() => Model

transformer

() => Transformer

Returns

object

model

model: object & Metadata

Type declaration

flavour

flavour: Flavour

props

props: PropsGetter<Props>

transformer()?

optional transformer: () => Transformer

Returns

Transformer

version

version: number

Defined in

packages/framework/store/src/schema/base.ts:72