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?: BlockOptions= {}

Returns

Block

Source

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

Properties

_byPassProxy

private _byPassProxy: boolean = false

Source

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


_stashed

private readonly _stashed: Set<string | number>

Source

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


blockViewType

blockViewType: BlockViewType = BlockViewType.Display

Source

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


doc?

optional readonly doc: Doc

Source

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


flavour

readonly flavour: string

Source

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


id

readonly id: string

Source

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


model

readonly model: BlockModel<object>

Source

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


options

readonly options: BlockOptions = {}

Source

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


schema

readonly schema: Schema

Source

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


version

readonly version: number

Source

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


yBlock

readonly yBlock: YBlock

Source

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


yChildren

readonly yChildren: Array<string[]>

Source

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

Methods

_byPassUpdate()

private _byPassUpdate(fn): void

Parameters

fn

Returns

void

Source

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


_createModel()

private _createModel(props): BlockModel<object>

Parameters

props: UnRecord

Returns

BlockModel<object>

Source

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


_getPropsProxy()

private _getPropsProxy(name, value): unknown

Parameters

name: string

value: unknown

Returns

unknown

Source

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


_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:175


_popProp()

private _popProp(prop): void

Parameters

prop: string

Returns

void

Source

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


_stashProp()

private _stashProp(prop): void

Parameters

prop: string

Returns

void

Source

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


pop()

pop(prop): void

Parameters

prop: string

Returns

void

Source

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


stash()

stash(prop): void

Parameters

prop: string

Returns

void

Source

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