Skip to content

BlockSuite API Documentation / @blocksuite/store / Schema

Class: Schema

Constructors

new Schema()

new Schema(): Schema

Returns

Schema

Properties

flavourSchemaMap

readonly flavourSchemaMap: Map<string, object>

Defined in

packages/framework/store/src/schema/schema.ts:10

Accessors

versions

get versions(): object

Returns

object

Defined in

packages/framework/store/src/schema/schema.ts:59

Methods

isValid()

isValid(child, parent): boolean

Parameters

child: string

parent: string

Returns

boolean

Defined in

packages/framework/store/src/schema/schema.ts:134


register()

register(blockSchema): Schema

Parameters

blockSchema: object[]

Returns

Schema

Defined in

packages/framework/store/src/schema/schema.ts:148


toJSON()

toJSON(): object

Returns

object

Defined in

packages/framework/store/src/schema/schema.ts:156


validate()

validate(flavour, parentFlavour?, childFlavours?): void

Parameters

flavour: string

parentFlavour?: string

childFlavours?: string[]

Returns

void

Defined in

packages/framework/store/src/schema/schema.ts:12


validateSchema()

validateSchema(child, parent): void

Parameters

child

child.model = ...

child.model.children?: string[] = ContentSchema

child.model.flavour: string = FlavourSchema

child.model.parent?: string[] = ParentSchema

child.model.props? = ...

child.model.role: "root" | "hub" | "content" = RoleSchema

child.model.toModel? = ...

child.transformer? = ...

child.version: number = ...

parent

parent.model = ...

parent.model.children?: string[] = ContentSchema

parent.model.flavour: string = FlavourSchema

parent.model.parent?: string[] = ParentSchema

parent.model.props? = ...

parent.model.role: "root" | "hub" | "content" = RoleSchema

parent.model.toModel? = ...

parent.transformer? = ...

parent.version: number = ...

Returns

void

Defined in

packages/framework/store/src/schema/schema.ts:171