API > @blocksuite/store > BlockSchema
Variable: BlockSchema ​
const
BlockSchema:ZodObject
< {model
:ZodObject
< {children
:ZodOptional
<ZodArray
<ZodString
,"many"
> >;flavour
:ZodString
;parent
:ZodOptional
<ZodArray
<ZodString
,"many"
> >;props
:ZodOptional
<ZodFunction
<ZodTuple
< [ZodType
<InternalPrimitives
,ZodTypeDef
,InternalPrimitives
>],ZodUnknown
>,ZodRecord
<ZodString
,ZodAny
> > >;role
:ZodEnum
< ["root"
,"hub"
,"content"
] >;toModel
:ZodOptional
<ZodFunction
<ZodTuple
< [],ZodUnknown
>,ZodType
<BaseBlockModel
<object
>,ZodTypeDef
,BaseBlockModel
<object
> > > >;},"strip"
,ZodTypeAny
, {children
:string
[];flavour
:string
;parent
:string
[];props
: (...args
) =>Record
<string
,any
>;role
:"root"
|"hub"
|"content"
;toModel
: (...args
) =>BaseBlockModel
<object
>;}, {children
:string
[];flavour
:string
;parent
:string
[];props
: (...args
) =>Record
<string
,any
>;role
:"root"
|"hub"
|"content"
;toModel
: (...args
) =>BaseBlockModel
<object
>;} >;onUpgrade
:ZodOptional
<ZodFunction
<ZodTuple
< [ZodAny
,ZodNumber
,ZodNumber
],ZodUnknown
>,ZodVoid
> >;transformer
:ZodOptional
<ZodFunction
<ZodTuple
< [],ZodUnknown
>,ZodType
<BaseBlockTransformer
<object
>,ZodTypeDef
,BaseBlockTransformer
<object
> > > >;version
:ZodNumber
;},"strip"
,ZodTypeAny
, {model
:{ flavour: string; role: "root" | "hub" | "content"; parent?: string[] | undefined; children?: string[] | undefined; props?: ((args_0: InternalPrimitives, ...args_1: unknown[]) => Record<...>) | undefined; toModel?: ((...args: unknown[]) => BaseBlockModel<...>) | undefined; }
;onUpgrade
: (...args
) =>void
;transformer
: (...args
) =>BaseBlockTransformer
<object
>;version
:number
;}, {model
:{ flavour: string; role: "root" | "hub" | "content"; parent?: string[] | undefined; children?: string[] | undefined; props?: ((args_0: InternalPrimitives, ...args_1: unknown[]) => Record<...>) | undefined; toModel?: ((...args: unknown[]) => BaseBlockModel<...>) | undefined; }
;onUpgrade
: (...args
) =>void
;transformer
: (...args
) =>BaseBlockTransformer
<object
>;version
:number
;} >
Defined In ​
packages/store/src/schema/base.ts:29