Skip to content

BlockSuite API Documentation / @blocksuite/block-std / BlockSpec

Interface: BlockSpec<WidgetNames, Service>

Type parameters

WidgetNames extends string = string

Service extends BlockService = BlockService

Properties

schema

schema: Object

schema.model

model: Object

schema.model.children?

optional children: string[]

schema.model.flavour

flavour: string

schema.model.parent?

optional parent: string[]

schema.model.props?

optional props: (args_0, ...args_1) => Record<string, any>

Parameters

args_0: InternalPrimitives

• ...args_1: unknown[]

Returns

Record<string, any>

schema.model.role

role: "root" | "hub" | "content"

schema.model.toModel?

optional toModel: (...args) => BlockModel<object>

Parameters

• ...args: unknown[]

Returns

BlockModel<object>

schema.onUpgrade?

optional onUpgrade: (args_0, args_1, args_2, ...args_3) => void

Parameters

args_0: any

args_1: number

args_2: number

• ...args_3: unknown[]

Returns

void

schema.transformer?

optional transformer: (...args) => BaseBlockTransformer<object>

Parameters

• ...args: unknown[]

Returns

BaseBlockTransformer<object>

schema.version

version: number

Source

block-std/src/spec/type.ts:17


service?

optional service: BlockServiceConstructor<Service>

Source

block-std/src/spec/type.ts:18


setup?

optional setup: (slots, disposableGroup) => void

Parameters

slots: BlockSpecSlots

disposableGroup: DisposableGroup

Returns

void

Source

block-std/src/spec/type.ts:20


view

view: BlockView<WidgetNames>

Source

block-std/src/spec/type.ts:19