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
<Object
>
• Model extends BaseBlockModel
<Props
>
• Transformer extends BaseBlockTransformer
<Props
>
Parameters ​
• options: Object
• options.flavour: Flavour
• options.metadata: Metadata
• options.onUpgrade?: (data
, previousVersion
, latestVersion
) => void
• options.props?: (internalPrimitives
) => Props
• options.toModel?: () => Model
• options.transformer?: () => Transformer
Returns ​
Object
model ​
model:
Object
&Metadata
Type declaration ​
flavour ​
flavour:
Flavour
props ​
props:
PropsGetter
<Props
>role ​
role:
Role
onUpgrade? ​
onUpgrade?: (
data
,previousVersion
,latestVersion
) =>void
Parameters ​
• data:
Props
• previousVersion:
number
• latestVersion:
number
Returns ​
void
transformer? ​
transformer?: () =>
Transformer
Returns ​
Transformer
version ​
version:
number
Source ​
packages/store/src/schema/base.ts:76
Generated using typedoc-plugin-markdown and TypeDoc