Skip to content

BlockSuite API Documentation / @blocksuite/store / BlockModel

Class: BlockModel<Props, PropsSignal>

Extends

  • PropsSignal

Extended by

Type Parameters

Props extends object = object

PropsSignal extends object = SignaledProps<Props>

Constructors

new BlockModel()

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

Returns

BlockModel<Props, PropsSignal>

Overrides

MagicProps()<PropsSignal>.constructor

Defined in

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

Properties

[modelLabel]

[modelLabel]: Props

Defined in

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


childMap

childMap: ReadonlySignal<Map<string, number>>

Defined in

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


created

created: Slot<void>

Defined in

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


deleted

deleted: Slot<void>

Defined in

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


flavour

flavour: string

Defined in

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


id

id: string

Defined in

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


isEmpty

isEmpty: ReadonlySignal<boolean>

Defined in

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


keys

keys: string[]

Defined in

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


page

page: Doc

Deprecated

use doc instead

Defined in

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


pop()

pop: (prop) => void

Parameters

prop: keyof Props & string

Returns

void

Defined in

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


propsUpdated

propsUpdated: Slot<object>

Type declaration

key

key: string

Defined in

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


role

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

Defined in

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


stash()

stash: (prop) => void

Parameters

prop: keyof Props & string

Returns

void

Defined in

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


text?

optional text: Text

Defined in

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


version

version: number

Defined in

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


yBlock

yBlock: YBlock

Defined in

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

Accessors

children

get children(): BlockModel<object, SignaledProps<object>>[]

Returns

BlockModel<object, SignaledProps<object>>[]

Defined in

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


doc

get doc(): Doc

set doc(doc): void

Parameters

doc: Doc

Returns

Doc

Defined in

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


parent

get parent(): null | BlockModel<object, SignaledProps<object>>

Returns

null | BlockModel<object, SignaledProps<object>>

Defined in

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

Methods

[dispose]()

[dispose](): void

Returns

void

Defined in

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


dispose()

dispose(): void

Returns

void

Defined in

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


firstChild()

firstChild(): null | BlockModel<object, SignaledProps<object>>

Returns

null | BlockModel<object, SignaledProps<object>>

Defined in

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


lastChild()

lastChild(): null | BlockModel<object, SignaledProps<object>>

Returns

null | BlockModel<object, SignaledProps<object>>

Defined in

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