Skip to content

BlockSuite API Documentation / @blocksuite/blocks / SurfaceBlockModel

Class: SurfaceBlockModel

Extends

Constructors

new SurfaceBlockModel(undefined)

new SurfaceBlockModel(): SurfaceBlockModel

Returns

SurfaceBlockModel

Overrides

BlockModel<SurfaceBlockProps>.constructor

Source

packages/blocks/src/surface-block/surface-model.ts:190

Properties

[modelLabel]

[modelLabel]: SurfaceBlockProps

Inherited from

BlockModel.[modelLabel]

Source

packages/framework/store/dist/schema/base.d.ts:101


_connectorToElements

private _connectorToElements: Map<string, string[]>

Source

packages/blocks/src/surface-block/surface-model.ts:173


_disposables

private _disposables: () => void[] = []

Source

packages/blocks/src/surface-block/surface-model.ts:170


_elementModels

private _elementModels: Map<string, Object>

Source

packages/blocks/src/surface-block/surface-model.ts:166


_elementToConnector

private _elementToConnector: Map<string, string[]>

Source

packages/blocks/src/surface-block/surface-model.ts:174


_elementToGroup

private _elementToGroup: Map<string, string>

Source

packages/blocks/src/surface-block/surface-model.ts:172


_groupToElements

private _groupToElements: Map<string, string[]>

Source

packages/blocks/src/surface-block/surface-model.ts:171


childrenUpdated

childrenUpdated: Slot<void>

Inherited from

BlockModel.childrenUpdated

Source

packages/framework/store/dist/schema/base.d.ts:120


created

created: Slot<void>

Inherited from

BlockModel.created

Source

packages/framework/store/dist/schema/base.d.ts:115


deleted

deleted: Slot<void>

Inherited from

BlockModel.deleted

Source

packages/framework/store/dist/schema/base.d.ts:116


elementAdded

elementAdded: Slot<Object>

Type declaration

id

id: string

Source

packages/blocks/src/surface-block/surface-model.ts:177


elementRemoved

elementRemoved: Slot<Object>

Type declaration

id

id: string

model

model: ElementModel<BaseProps>

type

type: string

Source

packages/blocks/src/surface-block/surface-model.ts:178


elementUpdated

elementUpdated: Slot<ElementUpdatedData>

Source

packages/blocks/src/surface-block/surface-model.ts:176


elements

elements: Boxed<Map<Map<unknown>>>

Inherited from

BlockModel.elements

Source

packages/blocks/src/surface-block/surface-model.ts:29


flavour

flavour: string

Inherited from

BlockModel.flavour

Source

packages/framework/store/dist/schema/base.d.ts:103


id

id: string

Inherited from

BlockModel.id

Source

packages/framework/store/dist/schema/base.d.ts:109


keys

keys: string[]

Inherited from

BlockModel.keys

Source

packages/framework/store/dist/schema/base.d.ts:111


page

page: Doc

Deprecated

use doc instead

Inherited from

BlockModel.page

Source

packages/framework/store/dist/schema/base.d.ts:108


pop

pop: (prop) => void

Parameters

prop: "elements"

Returns

void

Inherited from

BlockModel.pop

Source

packages/framework/store/dist/schema/base.d.ts:113


propsUpdated

propsUpdated: Slot<Object>

Type declaration

key

key: string

Inherited from

BlockModel.propsUpdated

Source

packages/framework/store/dist/schema/base.d.ts:117


role

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

Inherited from

BlockModel.role

Source

packages/framework/store/dist/schema/base.d.ts:104


stash

stash: (prop) => void

Parameters

prop: "elements"

Returns

void

Inherited from

BlockModel.stash

Source

packages/framework/store/dist/schema/base.d.ts:112


text?

text?: Text

Inherited from

BlockModel.text

Source

packages/framework/store/dist/schema/base.d.ts:114


version

version: number

Inherited from

BlockModel.version

Source

packages/framework/store/dist/schema/base.d.ts:102


yBlock

yBlock: YBlock

Inherited from

BlockModel.yBlock

Source

packages/framework/store/dist/schema/base.d.ts:110

Accessors

childMap

get childMap(): Map<string, number>

Returns

Map<string, number>

Source

packages/framework/store/dist/schema/base.d.ts:123


children

get children(): BlockModel<object>[]

Returns

BlockModel<object>[]

Source

packages/framework/store/dist/schema/base.d.ts:124


doc

get doc(): Doc

set doc(doc): void

Parameters

doc: Doc

Returns

Doc

Source

packages/framework/store/dist/schema/base.d.ts:121


elementModels

get elementModels(): ElementModel<BaseProps>[]

Returns

ElementModel<BaseProps>[]

Source

packages/blocks/src/surface-block/surface-model.ts:184

Methods

_applyMiddlewares()

private _applyMiddlewares(): void

Returns

void

Source

packages/blocks/src/surface-block/surface-model.ts:202


_init()

private _init(): void

Returns

void

Source

packages/blocks/src/surface-block/surface-model.ts:195


_initElementModels()

private _initElementModels(): void

Returns

void

Source

packages/blocks/src/surface-block/surface-model.ts:206


_watchConnectorRelationChange()

private _watchConnectorRelationChange(): void

Returns

void

Source

packages/blocks/src/surface-block/surface-model.ts:345


_watchGroupRelationChange()

private _watchGroupRelationChange(): void

Returns

void

Source

packages/blocks/src/surface-block/surface-model.ts:273


addElement()

addElement<T>(props): string

Type parameters

T extends object = Record<string, unknown>

Parameters

props: Partial<T> & Object

Returns

string

Source

packages/blocks/src/surface-block/surface-model.ts:485


dispose()

dispose(): void

Returns

void

Overrides

BlockModel.dispose

Source

packages/blocks/src/surface-block/surface-model.ts:434


firstChild()

firstChild(): null | BlockModel<object>

Returns

null | BlockModel<object>

Inherited from

BlockModel.firstChild

Source

packages/framework/store/dist/schema/base.d.ts:126


getConnectors()

getConnectors(id): ConnectorElementModel[]

Parameters

id: string

Returns

ConnectorElementModel[]

Source

packages/blocks/src/surface-block/surface-model.ts:447


getElementById()

getElementById(id): null | ElementModel<BaseProps>

Parameters

id: string

Returns

null | ElementModel<BaseProps>

Source

packages/blocks/src/surface-block/surface-model.ts:481


getElementsByType()

getElementsByType<K>(type): ElementModelMap[K][]

Type parameters

K extends keyof ElementModelMap

Parameters

type: K

Returns

ElementModelMap[K][]

Source

packages/blocks/src/surface-block/surface-model.ts:473


getGroup()

getGroup(id): null | GroupElementModel

Parameters

id: string

Returns

null | GroupElementModel

Source

packages/blocks/src/surface-block/surface-model.ts:453


getGroups()

getGroups(id): GroupElementModel[]

Parameters

id: string

Returns

GroupElementModel[]

Source

packages/blocks/src/surface-block/surface-model.ts:461


isEmpty()

isEmpty(): boolean

Returns

boolean

Inherited from

BlockModel.isEmpty

Source

packages/framework/store/dist/schema/base.d.ts:125


lastChild()

lastChild(): null | BlockModel<object>

Returns

null | BlockModel<object>

Inherited from

BlockModel.lastChild

Source

packages/framework/store/dist/schema/base.d.ts:127


lastItem()

lastItem(): null | BlockModel<object>

Returns

null | BlockModel<object>

Inherited from

BlockModel.lastItem

Source

packages/framework/store/dist/schema/base.d.ts:128


removeElement()

removeElement(id): void

Parameters

id: string

Returns

void

Source

packages/blocks/src/surface-block/surface-model.ts:510


updateElement()

updateElement<T>(id, props): void

Type parameters

T extends object = Record<string, unknown>

Parameters

id: string

props: Partial<T>

Returns

void

Source

packages/blocks/src/surface-block/surface-model.ts:520


Generated using TypeDoc and typedoc-plugin-markdown.