Skip to content

BlockSuite API Documentation / @blocksuite/store / Block

Class: Block

Constructors

new Block()

new Block(schema, yBlock, doc?, options?): Block

Parameters

schema: Schema

yBlock: YBlock

doc?: Doc

options?: Partial<object>= {}

Returns

Block

Source

packages/framework/store/src/store/doc/block.ts:91

Properties

_byPassProxy

private _byPassProxy: boolean = false

Source

packages/framework/store/src/store/doc/block.ts:27


_stashed

private readonly _stashed: Set<string | number>

Source

packages/framework/store/src/store/doc/block.ts:28


doc?

optional readonly doc: Doc

Source

packages/framework/store/src/store/doc/block.ts:94


flavour

readonly flavour: string

Source

packages/framework/store/src/store/doc/block.ts:24


id

readonly id: string

Source

packages/framework/store/src/store/doc/block.ts:23


model

readonly model: BlockModel<object>

Source

packages/framework/store/src/store/doc/block.ts:22


options

readonly options: Partial<object> = {}

Type declaration

onChange()

onChange: (block, key, value) => void

Parameters

block: Block

key: string

value: unknown

Returns

void

Source

packages/framework/store/src/store/doc/block.ts:95


schema

readonly schema: Schema

Source

packages/framework/store/src/store/doc/block.ts:92


version

readonly version: number

Source

packages/framework/store/src/store/doc/block.ts:25


yBlock

readonly yBlock: YBlock

Source

packages/framework/store/src/store/doc/block.ts:93


yChildren

readonly yChildren: Array<string[]>

Source

packages/framework/store/src/store/doc/block.ts:26

Methods

_byPassUpdate()

private _byPassUpdate(fn): void

Parameters

fn

Returns

void

Source

packages/framework/store/src/store/doc/block.ts:165


_createModel()

private _createModel(props): BlockModel<object>

Parameters

props: UnRecord

Returns

BlockModel<object>

Source

packages/framework/store/src/store/doc/block.ts:243


_getPropsProxy()

private _getPropsProxy(name, value): unknown

Parameters

name: string

value: unknown

Returns

unknown

Source

packages/framework/store/src/store/doc/block.ts:171


_parseYBlock()

private _parseYBlock(): object

Returns

object

flavour

flavour: string

id

id: string

props

props: Record<string, unknown>

version

version: number

yChildren

yChildren: Array<string[]>

Source

packages/framework/store/src/store/doc/block.ts:179


_popProp()

private _popProp(prop): void

Parameters

prop: string

Returns

void

Source

packages/framework/store/src/store/doc/block.ts:83


_stashProp()

private _stashProp(prop): void

Parameters

prop: string

Returns

void

Source

packages/framework/store/src/store/doc/block.ts:30


pop()

pop(prop): void

Parameters

prop: string

Returns

void

Source

packages/framework/store/src/store/doc/block.ts:160


stash()

stash(prop): void

Parameters

prop: string

Returns

void

Source

packages/framework/store/src/store/doc/block.ts:153