BlockSuite API Documentation / @blocksuite/blocks / SurfaceBlockModel
Class: SurfaceBlockModel
Extends
BlockModel
<SurfaceBlockProps
>
Constructors
new SurfaceBlockModel(undefined)
new SurfaceBlockModel():
SurfaceBlockModel
Returns
Overrides
BlockModel<SurfaceBlockProps>.constructor
Source
packages/blocks/src/surface-block/surface-model.ts:191
Properties
_connectorToElements
private
_connectorToElements:Map
<string
,string
[]>
Source
packages/blocks/src/surface-block/surface-model.ts:174
_disposables
private
_disposables: () =>void
[] =[]
Source
packages/blocks/src/surface-block/surface-model.ts:171
_elementModels
private
_elementModels:Map
<string
,Object
>
Source
packages/blocks/src/surface-block/surface-model.ts:167
_elementToConnector
private
_elementToConnector:Map
<string
,string
[]>
Source
packages/blocks/src/surface-block/surface-model.ts:175
_elementToGroup
private
_elementToGroup:Map
<string
,string
>
Source
packages/blocks/src/surface-block/surface-model.ts:173
_groupToElements
private
_groupToElements:Map
<string
,string
[]>
Source
packages/blocks/src/surface-block/surface-model.ts:172
childrenUpdated
childrenUpdated:
Slot
<void
>
Inherited from
BlockModel.childrenUpdated
Source
packages/framework/store/dist/schema/base.d.ts:117
created
created:
Slot
<void
>
Inherited from
BlockModel.created
Source
packages/framework/store/dist/schema/base.d.ts:112
deleted
deleted:
Slot
<void
>
Inherited from
BlockModel.deleted
Source
packages/framework/store/dist/schema/base.d.ts:113
elementAdded
elementAdded:
Slot
<Object
>
Type declaration
id
id:
string
Source
packages/blocks/src/surface-block/surface-model.ts:178
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:179
elementUpdated
elementUpdated:
Slot
<ElementUpdatedData
>
Source
packages/blocks/src/surface-block/surface-model.ts:177
elements
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:106
keys
keys:
string
[]
Inherited from
BlockModel.keys
Source
packages/framework/store/dist/schema/base.d.ts:108
page
page:
Page
Inherited from
BlockModel.page
Source
packages/framework/store/dist/schema/base.d.ts:105
pop
pop: (
prop
) =>void
Parameters
• prop: "elements"
Returns
void
Inherited from
BlockModel.pop
Source
packages/framework/store/dist/schema/base.d.ts:110
propsUpdated
propsUpdated:
Slot
<Object
>
Type declaration
key
key:
string
Inherited from
BlockModel.propsUpdated
Source
packages/framework/store/dist/schema/base.d.ts:114
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:109
text?
text?:
Text
Inherited from
BlockModel.text
Source
packages/framework/store/dist/schema/base.d.ts:111
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:107
Accessors
childMap
get
childMap():Map
<string
,number
>
Returns
Map
<string
, number
>
Source
packages/framework/store/dist/schema/base.d.ts:118
children
get
children():BlockModel
<object
>[]
Returns
BlockModel
<object
>[]
Source
packages/framework/store/dist/schema/base.d.ts:119
elementModels
get
elementModels():ElementModel
<BaseProps
>[]
Returns
ElementModel
<BaseProps
>[]
Source
packages/blocks/src/surface-block/surface-model.ts:185
Methods
_applyMiddlewares()
private
_applyMiddlewares():void
Returns
void
Source
packages/blocks/src/surface-block/surface-model.ts:203
_init()
private
_init():void
Returns
void
Source
packages/blocks/src/surface-block/surface-model.ts:196
_initElementModels()
private
_initElementModels():void
Returns
void
Source
packages/blocks/src/surface-block/surface-model.ts:207
_watchConnectorRelationChange()
private
_watchConnectorRelationChange():void
Returns
void
Source
packages/blocks/src/surface-block/surface-model.ts:346
_watchGroupRelationChange()
private
_watchGroupRelationChange():void
Returns
void
Source
packages/blocks/src/surface-block/surface-model.ts:274
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:486
clone()
clone():
this
Returns
this
Inherited from
BlockModel.clone
Source
packages/framework/store/dist/schema/base.d.ts:125
dispose()
dispose():
void
Returns
void
Overrides
BlockModel.dispose
Source
packages/blocks/src/surface-block/surface-model.ts:435
firstChild()
firstChild():
null
|BlockModel
<object
>
Returns
null
| BlockModel
<object
>
Inherited from
BlockModel.firstChild
Source
packages/framework/store/dist/schema/base.d.ts:121
getConnectors()
getConnectors(
id
):ConnectorElementModel
[]
Parameters
• id: string
Returns
Source
packages/blocks/src/surface-block/surface-model.ts:448
getElementById()
getElementById(
id
):null
|ElementModel
<BaseProps
>
Parameters
• id: string
Returns
null
| ElementModel
<BaseProps
>
Source
packages/blocks/src/surface-block/surface-model.ts:482
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:474
getGroup()
getGroup(
id
):null
|GroupElementModel
Parameters
• id: string
Returns
null
| GroupElementModel
Source
packages/blocks/src/surface-block/surface-model.ts:454
getGroups()
getGroups(
id
):GroupElementModel
[]
Parameters
• id: string
Returns
Source
packages/blocks/src/surface-block/surface-model.ts:462
isEmpty()
isEmpty():
boolean
Returns
boolean
Inherited from
BlockModel.isEmpty
Source
packages/framework/store/dist/schema/base.d.ts:120
lastChild()
lastChild():
null
|BlockModel
<object
>
Returns
null
| BlockModel
<object
>
Inherited from
BlockModel.lastChild
Source
packages/framework/store/dist/schema/base.d.ts:122
lastItem()
lastItem():
null
|BlockModel
<object
>
Returns
null
| BlockModel
<object
>
Inherited from
BlockModel.lastItem
Source
packages/framework/store/dist/schema/base.d.ts:123
removeElement()
removeElement(
id
):void
Parameters
• id: string
Returns
void
Source
packages/blocks/src/surface-block/surface-model.ts:511
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:521
Generated using TypeDoc and typedoc-plugin-markdown.