Skip to content

BlockSuite API Documentation / @blocksuite/store / BlockModel

Class: BlockModel<Props>

Extends

  • Props

Type parameters

Props extends object = object

Constructors

new BlockModel(undefined)

new BlockModel<Props>(): BlockModel<Props>

Returns

BlockModel<Props>

Inherited from

MagicProps()<Props>.constructor

Source

packages/framework/store/src/schema/base.ts:163

Properties

[modelLabel]

[modelLabel]: Props

Source

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


childrenUpdated

childrenUpdated: Slot<void>

Source

packages/framework/store/src/schema/base.ts:197


created

created: Slot<void>

Source

packages/framework/store/src/schema/base.ts:194


deleted

deleted: Slot<void>

Source

packages/framework/store/src/schema/base.ts:195


flavour

flavour: string

Source

packages/framework/store/src/schema/base.ts:178


id

id: string

Source

packages/framework/store/src/schema/base.ts:184


keys

keys: string[]

Source

packages/framework/store/src/schema/base.ts:186


page

page: Doc

Deprecated

use doc instead

Source

packages/framework/store/src/schema/base.ts:183


pop()

pop: (prop) => void

Parameters

prop: keyof Props & string

Returns

void

Source

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


propsUpdated

propsUpdated: Slot<object>

Type declaration

key

key: string

Source

packages/framework/store/src/schema/base.ts:196


role

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

Source

packages/framework/store/src/schema/base.ts:179


stash()

stash: (prop) => void

Parameters

prop: keyof Props & string

Returns

void

Source

packages/framework/store/src/schema/base.ts:188


text?

optional text: Text

Source

packages/framework/store/src/schema/base.ts:192


version

version: number

Source

packages/framework/store/src/schema/base.ts:177


yBlock

yBlock: YBlock

Source

packages/framework/store/src/schema/base.ts:185

Accessors

childMap

get childMap(): Map<string, number>

Returns

Map<string, number>

Source

packages/framework/store/src/schema/base.ts:207


children

get children(): BlockModel<object>[]

Returns

BlockModel<object>[]

Source

packages/framework/store/src/schema/base.ts:214


doc

get doc(): Doc

set doc(doc): void

Parameters

doc: Doc

Returns

Doc

Source

packages/framework/store/src/schema/base.ts:199

Methods

dispose()

dispose(): void

Returns

void

Source

packages/framework/store/src/schema/base.ts:247


firstChild()

firstChild(): null | BlockModel<object>

Returns

null | BlockModel<object>

Source

packages/framework/store/src/schema/base.ts:236


isEmpty()

isEmpty(): boolean

Returns

boolean

Source

packages/framework/store/src/schema/base.ts:232


lastChild()

lastChild(): null | BlockModel<object>

Returns

null | BlockModel<object>

Source

packages/framework/store/src/schema/base.ts:240