Skip to content

BlockSuite API Documentation / @blocksuite/blocks / SurfaceBlockModel

Class: SurfaceBlockModel

Extends

  • SurfaceBlockModel

Constructors

new SurfaceBlockModel()

new SurfaceBlockModel(): SurfaceBlockModel

Returns

SurfaceBlockModel

Inherited from

BaseSurfaceModel.constructor

Defined in

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

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/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/surface/surface-model.d.ts:31


_elementModels

protected _elementModels: Map<string, object>

Inherited from

BaseSurfaceModel._elementModels

Defined in

packages/framework/block-std/dist/gfx/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/surface/surface-model.d.ts:37


_middlewares

protected _middlewares: SurfaceMiddleware[]

Inherited from

BaseSurfaceModel._middlewares

Defined in

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


_surfaceBlockModel

protected _surfaceBlockModel: boolean

Inherited from

BaseSurfaceModel._surfaceBlockModel

Defined in

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


[modelLabel]

[modelLabel]: SurfaceBlockProps

Inherited from

BaseSurfaceModel.[modelLabel]

Defined in

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


childMap

childMap: ReadonlySignal<Map<string, number>>

Inherited from

BaseSurfaceModel.childMap

Defined in

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


created

created: Slot<void>

Inherited from

BaseSurfaceModel.created

Defined in

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


deleted

deleted: Slot<void>

Inherited from

BaseSurfaceModel.deleted

Defined in

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


elementAdded

elementAdded: Slot<object>

Type declaration

id

id: string

local

local: boolean

Inherited from

BaseSurfaceModel.elementAdded

Defined in

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


elementRemoved

elementRemoved: Slot<object>

Type declaration

id

id: string

local

local: boolean

model

model: SurfaceElementModel<BaseElementProps>

type

type: string

Inherited from

BaseSurfaceModel.elementRemoved

Defined in

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


elements

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

Inherited from

BaseSurfaceModel.elements

Defined in

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


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/surface/surface-model.d.ts:50


flavour

flavour: string

Inherited from

BaseSurfaceModel.flavour

Defined in

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


id

id: string

Inherited from

BaseSurfaceModel.id

Defined in

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


isEmpty

isEmpty: ReadonlySignal<boolean>

Inherited from

BaseSurfaceModel.isEmpty

Defined in

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


keys

keys: string[]

Inherited from

BaseSurfaceModel.keys

Defined in

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


page

page: Doc

Deprecated

use doc instead

Inherited from

BaseSurfaceModel.page

Defined in

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


pop()

pop: (prop) => void

Parameters

prop: "elements"

Returns

void

Inherited from

BaseSurfaceModel.pop

Defined in

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


propsUpdated

propsUpdated: Slot<object>

Type declaration

key

key: string

Inherited from

BaseSurfaceModel.propsUpdated

Defined in

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


role

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

Inherited from

BaseSurfaceModel.role

Defined in

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


stash()

stash: (prop) => void

Parameters

prop: "elements"

Returns

void

Inherited from

BaseSurfaceModel.stash

Defined in

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


text?

optional text: Text

Inherited from

BaseSurfaceModel.text

Defined in

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


version

version: number

Inherited from

BaseSurfaceModel.version

Defined in

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


yBlock

yBlock: YBlock

Inherited from

BaseSurfaceModel.yBlock

Defined in

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

Accessors

children

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:130


doc

get doc(): Doc

set doc(doc): void

Parameters

doc: Doc

Returns

Doc

Inherited from

BaseSurfaceModel.doc

Defined in

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


elementModels

get elementModels(): SurfaceElementModel<BaseElementProps>[]

Returns

SurfaceElementModel<BaseElementProps>[]

Inherited from

BaseSurfaceModel.elementModels

Defined in

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


parent

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:133


registeredElementTypes

get registeredElementTypes(): string[]

Returns

string[]

Inherited from

BaseSurfaceModel.registeredElementTypes

Defined in

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

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/surface/surface-model.d.ts:60


_init()

_init(): void

Returns

void

Overrides

BaseSurfaceModel._init

Defined in

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


[dispose]()

[dispose](): void

Returns

void

Inherited from

BaseSurfaceModel.[dispose]

Defined in

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


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/surface/surface-model.d.ts:62


applyMiddlewares()

applyMiddlewares(middlewares): void

Parameters

middlewares: SurfaceMiddleware[]

Returns

void

Inherited from

BaseSurfaceModel.applyMiddlewares

Defined in

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


deleteElement()

deleteElement(id): void

Parameters

id: string

Returns

void

Inherited from

BaseSurfaceModel.deleteElement

Defined in

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


dispose()

dispose(): void

Returns

void

Inherited from

BaseSurfaceModel.dispose

Defined in

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


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:136


getConnectors()

getConnectors(id): ConnectorElementModel[]

Parameters

id: string

Returns

ConnectorElementModel[]

Defined in

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


getContainer()

getContainer(elementId): null | GfxModel & GfxContainerElement

Parameters

elementId: string

Returns

null | GfxModel & GfxContainerElement

Inherited from

BaseSurfaceModel.getContainer

Defined in

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


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/surface/surface-model.d.ts:69


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:24


getGroup()

getGroup<T>(id): null | T

Type Parameters

T extends SurfaceGroupLikeModel<BaseElementProps> = SurfaceGroupLikeModel<BaseElementProps>

Parameters

id: string

Returns

null | T

Inherited from

BaseSurfaceModel.getGroup

Defined in

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


getGroups()

getGroups(id): SurfaceGroupLikeModel<BaseElementProps>[]

Parameters

id: string

Returns

SurfaceGroupLikeModel<BaseElementProps>[]

Inherited from

BaseSurfaceModel.getGroups

Defined in

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


hasElementById()

hasElementById(id): boolean

Parameters

id: string

Returns

boolean

Inherited from

BaseSurfaceModel.hasElementById

Defined in

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


isContainer()

isContainer(element)

isContainer(element): element is GfxModel & GfxContainerElement

Parameters

element: GfxModel

Returns

element is GfxModel & GfxContainerElement

Inherited from

BaseSurfaceModel.isContainer

Defined in

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

isContainer(id)

isContainer(id): boolean

Parameters

id: string

Returns

boolean

Inherited from

BaseSurfaceModel.isContainer

Defined in

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


isInMindmap()

isInMindmap(id): boolean

Parameters

id: string

Returns

boolean

Inherited from

BaseSurfaceModel.isInMindmap

Defined in

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


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:137


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/surface/surface-model.d.ts:77