Skip to content

BlockSuite API Documentation / @blocksuite/blocks / SurfaceBlockModel

Class: SurfaceBlockModel

Extends

Constructors

new SurfaceBlockModel()

new SurfaceBlockModel(): SurfaceBlockModel

Returns

SurfaceBlockModel

Inherited from

BaseSurfaceModel.constructor

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:63

Properties

_decoratorState

protected _decoratorState: object

creating

creating: boolean

deriving

deriving: boolean

skipField

skipField: boolean

Inherited from

BaseSurfaceModel._decoratorState

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:26


_elementCtorMap

protected _elementCtorMap: Record<string, Constructor<SurfaceElementModel<BaseElementProps>, [object]>>

Inherited from

BaseSurfaceModel._elementCtorMap

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:31


_elementModels

protected _elementModels: Map<string, { model: SurfaceElementModel<BaseElementProps>; mount: () => void; unmount: () => void; }>

Inherited from

BaseSurfaceModel._elementModels

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:32


_elementTypeMap

protected _elementTypeMap: Map<string, SurfaceElementModel<BaseElementProps>[]>

Inherited from

BaseSurfaceModel._elementTypeMap

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:37


_groupLikeModels

protected _groupLikeModels: Map<string, GfxGroupModel>

Inherited from

BaseSurfaceModel._groupLikeModels

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:38


_middlewares

protected _middlewares: SurfaceMiddleware[]

Inherited from

BaseSurfaceModel._middlewares

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:39


_surfaceBlockModel

protected _surfaceBlockModel: boolean

Inherited from

BaseSurfaceModel._surfaceBlockModel

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:40


[modelLabel]

[modelLabel]: SurfaceBlockProps

Inherited from

BaseSurfaceModel.[modelLabel]

Defined in

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


childMap

childMap: ReadonlySignal<Map<string, number>>

Inherited from

BaseSurfaceModel.childMap

Defined in

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


created

created: Slot<void>

Inherited from

BaseSurfaceModel.created

Defined in

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


deleted

deleted: Slot<void>

Inherited from

BaseSurfaceModel.deleted

Defined in

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


elementAdded

elementAdded: Slot<{ id: string; local: boolean; }>

Inherited from

BaseSurfaceModel.elementAdded

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:41


elementRemoved

elementRemoved: Slot<{ id: string; local: boolean; model: SurfaceElementModel<BaseElementProps>; type: string; }>

Inherited from

BaseSurfaceModel.elementRemoved

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:45


elements

elements: Boxed<YMap<YMap<unknown>>>

Inherited from

BaseSurfaceModel.elements

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:9


elements$

elements$: Signal<Boxed<YMap<YMap<unknown>>>>

Inherited from

BaseSurfaceModel.elements$


elementUpdated

elementUpdated: Slot<ElementUpdatedData>

Inherited from

BaseSurfaceModel.elementUpdated

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:51


flavour

flavour: string

Inherited from

BaseSurfaceModel.flavour

Defined in

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


id

id: string

Inherited from

BaseSurfaceModel.id

Defined in

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


isEmpty

isEmpty: ReadonlySignal<boolean>

Inherited from

BaseSurfaceModel.isEmpty

Defined in

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


keys

keys: string[]

Inherited from

BaseSurfaceModel.keys

Defined in

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


localElementAdded

localElementAdded: Slot<GfxLocalElementModel>

Inherited from

BaseSurfaceModel.localElementAdded

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:52


localElementDeleted

localElementDeleted: Slot<GfxLocalElementModel>

Inherited from

BaseSurfaceModel.localElementDeleted

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:53


localElements

protected localElements: Set<GfxLocalElementModel>

Inherited from

BaseSurfaceModel.localElements

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:54


localElementUpdated

localElementUpdated: Slot<{ model: GfxLocalElementModel; oldValues: Record<string, unknown>; props: Record<string, unknown>; }>

Inherited from

BaseSurfaceModel.localElementUpdated

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:55


page

page: Doc

Deprecated

use doc instead

Inherited from

BaseSurfaceModel.page

Defined in

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


pop()

pop: (prop) => void

Parameters

prop

"elements"

Returns

void

Inherited from

BaseSurfaceModel.pop

Defined in

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


propsUpdated

propsUpdated: Slot<{ key: string; }>

Inherited from

BaseSurfaceModel.propsUpdated

Defined in

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


role

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

Inherited from

BaseSurfaceModel.role

Defined in

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


stash()

stash: (prop) => void

Parameters

prop

"elements"

Returns

void

Inherited from

BaseSurfaceModel.stash

Defined in

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


text?

optional text: Text

Inherited from

BaseSurfaceModel.text

Defined in

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


version

version: number

Inherited from

BaseSurfaceModel.version

Defined in

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


yBlock

yBlock: YBlock

Inherited from

BaseSurfaceModel.yBlock

Defined in

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

Accessors

children

Get Signature

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

Returns

BlockModel<object, SignaledProps<object>>[]

Inherited from

BaseSurfaceModel.children

Defined in

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


doc

Get Signature

get doc(): Doc

Returns

Doc

Set Signature

set doc(doc): void

Parameters
doc

Doc

Returns

void

Inherited from

BaseSurfaceModel.doc

Defined in

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


elementModels

Get Signature

get elementModels(): SurfaceElementModel<BaseElementProps>[]

Returns

SurfaceElementModel<BaseElementProps>[]

Inherited from

BaseSurfaceModel.elementModels

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:60


localElementModels

Get Signature

get localElementModels(): Set<GfxLocalElementModel>

Returns

Set<GfxLocalElementModel>

Inherited from

BaseSurfaceModel.localElementModels

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:61


parent

Get Signature

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

Returns

null | BlockModel<object, SignaledProps<object>>

Inherited from

BaseSurfaceModel.parent

Defined in

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


registeredElementTypes

Get Signature

get registeredElementTypes(): string[]

Returns

string[]

Inherited from

BaseSurfaceModel.registeredElementTypes

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:62

Methods

_extendElement()

protected _extendElement(ctorMap): void

Parameters

ctorMap

Record<string, Constructor<SurfaceElementModel<BaseElementProps>, [object]>>

Returns

void

Inherited from

BaseSurfaceModel._extendElement

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:69


_init()

_init(): void

Returns

void

Overrides

BaseSurfaceModel._init

Defined in

packages/affine/block-surface/dist/surface-model.d.ts:21


[dispose]()

[dispose](): void

Returns

void

Inherited from

BaseSurfaceModel.[dispose]

Defined in

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


addElement()

addElement<T>(props): string

Type Parameters

T extends object = Record<string, unknown>

Parameters

props

Partial<T> & object

Returns

string

Inherited from

BaseSurfaceModel.addElement

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:71


addLocalElement()

addLocalElement(elem): void

Parameters

elem

GfxLocalElementModel

Returns

void

Inherited from

BaseSurfaceModel.addLocalElement

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:74


applyMiddlewares()

applyMiddlewares(middlewares): void

Parameters

middlewares

SurfaceMiddleware[]

Returns

void

Inherited from

BaseSurfaceModel.applyMiddlewares

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:75


deleteElement()

deleteElement(id): void

Parameters

id

string

Returns

void

Inherited from

BaseSurfaceModel.deleteElement

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:76


deleteLocalElement()

deleteLocalElement(elem): void

Parameters

elem

GfxLocalElementModel

Returns

void

Inherited from

BaseSurfaceModel.deleteLocalElement

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:77


dispose()

dispose(): void

Returns

void

Inherited from

BaseSurfaceModel.dispose

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:78


firstChild()

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

Returns

null | BlockModel<object, SignaledProps<object>>

Inherited from

BaseSurfaceModel.firstChild

Defined in

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


getConnectors()

getConnectors(id): ConnectorElementModel[]

Parameters

id

string

Returns

ConnectorElementModel[]

Defined in

packages/affine/block-surface/dist/surface-model.d.ts:22


getElementById()

getElementById(id): null | SurfaceElementModel<BaseElementProps>

Parameters

id

string

Returns

null | SurfaceElementModel<BaseElementProps>

Inherited from

BaseSurfaceModel.getElementById

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:79


getElementsByType()

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

Type Parameters

K extends keyof SurfaceElementModelMap

Parameters

type

K

Returns

SurfaceElementModelMap[K][]

Overrides

BaseSurfaceModel.getElementsByType

Defined in

packages/affine/block-surface/dist/surface-model.d.ts:23


getGroup()

getGroup(elem): null | GfxGroupModel

Parameters

elem

string | GfxModel

Returns

null | GfxGroupModel

Inherited from

BaseSurfaceModel.getGroup

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:81


getGroups()

getGroups(id): GfxGroupModel[]

Parameters

id

string

Returns

GfxGroupModel[]

Inherited from

BaseSurfaceModel.getGroups

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:82


hasElementById()

hasElementById(id): boolean

Parameters

id

string

Returns

boolean

Inherited from

BaseSurfaceModel.hasElementById

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:83


isGroup()

Call Signature

isGroup(element): element is GfxModel & GfxGroupCompatibleInterface

Parameters
element

GfxModel

Returns

element is GfxModel & GfxGroupCompatibleInterface

Inherited from

BaseSurfaceModel.isGroup

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:84

Call Signature

isGroup(id): boolean

Parameters
id

string

Returns

boolean

Inherited from

BaseSurfaceModel.isGroup

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:85


lastChild()

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

Returns

null | BlockModel<object, SignaledProps<object>>

Inherited from

BaseSurfaceModel.lastChild

Defined in

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


updateElement()

updateElement<T>(id, props): void

Type Parameters

T extends object = Record<string, unknown>

Parameters

id

string

props

Partial<T>

Returns

void

Inherited from

BaseSurfaceModel.updateElement

Defined in

packages/framework/block-std/dist/gfx/model/surface/surface-model.d.ts:86