Skip to content

BlockSuite API Documentation / @blocksuite/store / Schema

Class: Schema

Constructors

new Schema(undefined)

new Schema(): Schema

Returns

Schema

Properties

flavourSchemaMap

readonly flavourSchemaMap: Map<string, Object>

Source

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

Accessors

versions

get versions(): Object

Returns

Object

Source

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

Methods

_matchFlavour()

private _matchFlavour(childFlavour, parentFlavour): boolean

Parameters

childFlavour: string

parentFlavour: string

Returns

boolean

Source

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


_upgradeBlockVersions()

private _upgradeBlockVersions(rootData): void

Parameters

rootData: Doc

Returns

void

Source

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


_validateParent()

private _validateParent(child, parent): boolean

Parameters

child: Object

child.model: Object= undefined

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

child.model.flavour: string= FlavourSchema

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

child.model.props?: (...args) => Record<string, any>= undefined

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

child.model.toModel?: (...args) => BlockModel<object>= undefined

child.onUpgrade?: (...args) => void= undefined

child.transformer?: (...args) => BaseBlockTransformer<object>= undefined

child.version: number= undefined

parent: Object

parent.model: Object= undefined

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

parent.model.flavour: string= FlavourSchema

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

parent.model.props?: (...args) => Record<string, any>= undefined

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

parent.model.toModel?: (...args) => BlockModel<object>= undefined

parent.onUpgrade?: (...args) => void= undefined

parent.transformer?: (...args) => BaseBlockTransformer<object>= undefined

parent.version: number= undefined

Returns

boolean

Source

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


_validateRole()

private _validateRole(child, parent): void

Parameters

child: Object

child.model: Object= undefined

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

child.model.flavour: string= FlavourSchema

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

child.model.props?: (...args) => Record<string, any>= undefined

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

child.model.toModel?: (...args) => BlockModel<object>= undefined

child.onUpgrade?: (...args) => void= undefined

child.transformer?: (...args) => BaseBlockTransformer<object>= undefined

child.version: number= undefined

parent: Object

parent.model: Object= undefined

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

parent.model.flavour: string= FlavourSchema

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

parent.model.props?: (...args) => Record<string, any>= undefined

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

parent.model.toModel?: (...args) => BlockModel<object>= undefined

parent.onUpgrade?: (...args) => void= undefined

parent.transformer?: (...args) => BaseBlockTransformer<object>= undefined

parent.version: number= undefined

Returns

void

Source

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


register()

register(blockSchema): Schema

Parameters

blockSchema: Object[]

Returns

Schema

Source

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


toJSON()

toJSON(): Object

Returns

Object

Source

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


upgradeBlock()

upgradeBlock(flavour, oldVersion, blockData): void

Parameters

flavour: string

oldVersion: number

blockData: Map<unknown>

Returns

void

Source

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


upgradePage()

upgradePage(oldPageVersion, oldBlockVersions, pageData): void

Parameters

oldPageVersion: number

oldBlockVersions: Record<string, number>

pageData: Doc

Returns

void

Source

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


upgradeWorkspace()

upgradeWorkspace(rootData): void

Parameters

rootData: Doc

Returns

void

Source

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


validate()

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

Parameters

flavour: string

parentFlavour?: string

childFlavours?: string[]

Returns

void

Source

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


validateSchema()

validateSchema(child, parent): void

Parameters

child: Object

child.model: Object= undefined

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

child.model.flavour: string= FlavourSchema

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

child.model.props?: (...args) => Record<string, any>= undefined

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

child.model.toModel?: (...args) => BlockModel<object>= undefined

child.onUpgrade?: (...args) => void= undefined

child.transformer?: (...args) => BaseBlockTransformer<object>= undefined

child.version: number= undefined

parent: Object

parent.model: Object= undefined

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

parent.model.flavour: string= FlavourSchema

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

parent.model.props?: (...args) => Record<string, any>= undefined

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

parent.model.toModel?: (...args) => BlockModel<object>= undefined

parent.onUpgrade?: (...args) => void= undefined

parent.transformer?: (...args) => BaseBlockTransformer<object>= undefined

parent.version: number= undefined

Returns

void

Source

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


Generated using TypeDoc and typedoc-plugin-markdown.