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

Type declaration

model

model: Object

model.children?

model.children?: string[]

model.flavour

model.flavour: string

model.parent?

model.parent?: string[]

model.props?

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

Parameters

args_0: InternalPrimitives

• ...args_1: unknown[]

Returns

Record<string, any>

model.role

model.role: "root" | "hub" | "content"

model.toModel?

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

Parameters

• ...args: unknown[]

Returns

BlockModel<object>

onUpgrade?

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

transformer?

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

Parameters

• ...args: unknown[]

Returns

BaseBlockTransformer<object>

version

version: number

Source

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


service?

service?: BlockServiceConstructor<Service>

Source

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


setup?

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


Generated using TypeDoc and typedoc-plugin-markdown.