BlockSuite API Documentation / @blocksuite/blocks / SurfaceBlockModel
Class: SurfaceBlockModel
Extends
BlockModel
<SurfaceBlockProps
>
Contents
Constructors
new SurfaceBlockModel(undefined)
new SurfaceBlockModel():
SurfaceBlockModel
Returns
Overrides
BlockModel<SurfaceBlockProps>.constructor
Source
packages/blocks/src/surface-block/surface-model.ts:179
Properties
_connectorToElements
private
_connectorToElements:Map
<string
,string
[]>
Source
packages/blocks/src/surface-block/surface-model.ts:163
_disposables
private
_disposables: () =>void
[] =[]
Source
packages/blocks/src/surface-block/surface-model.ts:160
_elementModels
private
_elementModels:Map
<string
,Object
>
Source
packages/blocks/src/surface-block/surface-model.ts:156
_elementToConnector
private
_elementToConnector:Map
<string
,string
[]>
Source
packages/blocks/src/surface-block/surface-model.ts:164
_elementToGroup
private
_elementToGroup:Map
<string
,string
>
Source
packages/blocks/src/surface-block/surface-model.ts:162
_groupToElements
private
_groupToElements:Map
<string
,string
[]>
Source
packages/blocks/src/surface-block/surface-model.ts:161
childrenUpdated
childrenUpdated:
Slot
<void
>
Inherited from
BlockModel.childrenUpdated
Source
packages/store/dist/schema/base.d.ts:116
created
created:
Slot
<void
>
Inherited from
BlockModel.created
Source
packages/store/dist/schema/base.d.ts:111
deleted
deleted:
Slot
<void
>
Inherited from
BlockModel.deleted
Source
packages/store/dist/schema/base.d.ts:112
elementAdded
elementAdded:
Slot
<Object
>
Type declaration
id
id:
string
Source
packages/blocks/src/surface-block/surface-model.ts:170
elementRemoved
elementRemoved:
Slot
<Object
>
Type declaration
id
id:
string
type
type:
string
Source
packages/blocks/src/surface-block/surface-model.ts:171
elementUpdated
elementUpdated:
Slot
<Object
>
Type declaration
id
id:
string
props
props:
Record
<string
,Object
>
Source
packages/blocks/src/surface-block/surface-model.ts:166
elements
Inherited from
BlockModel.elements
Source
packages/blocks/src/surface-block/surface-model.ts:26
flavour
flavour:
string
Inherited from
BlockModel.flavour
Source
packages/store/dist/schema/base.d.ts:102
id
id:
string
Inherited from
BlockModel.id
Source
packages/store/dist/schema/base.d.ts:105
keys
keys:
string
[]
Inherited from
BlockModel.keys
Source
packages/store/dist/schema/base.d.ts:107
page
page:
Page
Inherited from
BlockModel.page
Source
packages/store/dist/schema/base.d.ts:104
pop
pop: (
prop
) =>void
Parameters
• prop: "elements"
Returns
void
Inherited from
BlockModel.pop
Source
packages/store/dist/schema/base.d.ts:109
propsUpdated
propsUpdated:
Slot
<Object
>
Type declaration
key
key:
string
Inherited from
BlockModel.propsUpdated
Source
packages/store/dist/schema/base.d.ts:113
role
role:
"root"
|"hub"
|"content"
Inherited from
BlockModel.role
Source
packages/store/dist/schema/base.d.ts:103
stash
stash: (
prop
) =>void
Parameters
• prop: "elements"
Returns
void
Inherited from
BlockModel.stash
Source
packages/store/dist/schema/base.d.ts:108
text?
text?:
Text
Inherited from
BlockModel.text
Source
packages/store/dist/schema/base.d.ts:110
yBlock
yBlock:
YBlock
Inherited from
BlockModel.yBlock
Source
packages/store/dist/schema/base.d.ts:106
Accessors
childMap
get
childMap():Map
<string
,number
>
Returns
Map
<string
, number
>
Source
packages/store/dist/schema/base.d.ts:117
children
get
children():BlockModel
<object
>[]
Returns
BlockModel
<object
>[]
Source
packages/store/dist/schema/base.d.ts:118
elementModels
get
elementModels():ElementModel
<BaseProps
>[]
Returns
ElementModel
<BaseProps
>[]
Source
packages/blocks/src/surface-block/surface-model.ts:173
Methods
_init()
private
_init():void
Returns
void
Source
packages/blocks/src/surface-block/surface-model.ts:184
_initConnector()
private
_initConnector():void
Returns
void
Source
packages/blocks/src/surface-block/surface-model.ts:324
_initElementModels()
private
_initElementModels():void
Returns
void
Source
packages/blocks/src/surface-block/surface-model.ts:190
_initGroup()
private
_initGroup():void
Returns
void
Source
packages/blocks/src/surface-block/surface-model.ts:256
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:441
clone()
clone():
this
Returns
this
Inherited from
BlockModel.clone
Source
packages/store/dist/schema/base.d.ts:124
dispose()
dispose():
void
Returns
void
Overrides
BlockModel.dispose
Source
packages/blocks/src/surface-block/surface-model.ts:410
firstChild()
firstChild():
null
|BlockModel
<object
>
Returns
null
| BlockModel
<object
>
Inherited from
BlockModel.firstChild
Source
packages/store/dist/schema/base.d.ts:120
getConnectors()
getConnectors(
id
):ElementModel
<BaseProps
>[]
Parameters
• id: string
Returns
ElementModel
<BaseProps
>[]
Source
packages/blocks/src/surface-block/surface-model.ts:423
getElementById()
getElementById(
id
):null
|ElementModel
<BaseProps
>
Parameters
• id: string
Returns
null
| ElementModel
<BaseProps
>
Source
packages/blocks/src/surface-block/surface-model.ts:437
getGroup()
getGroup(
id
):null
|GroupElementModel
Parameters
• id: string
Returns
null
| GroupElementModel
Source
packages/blocks/src/surface-block/surface-model.ts:429
isEmpty()
isEmpty():
boolean
Returns
boolean
Inherited from
BlockModel.isEmpty
Source
packages/store/dist/schema/base.d.ts:119
lastChild()
lastChild():
null
|BlockModel
<object
>
Returns
null
| BlockModel
<object
>
Inherited from
BlockModel.lastChild
Source
packages/store/dist/schema/base.d.ts:121
lastItem()
lastItem():
null
|BlockModel
<object
>
Returns
null
| BlockModel
<object
>
Inherited from
BlockModel.lastItem
Source
packages/store/dist/schema/base.d.ts:122
removeElement()
removeElement(
id
):void
Parameters
• id: string
Returns
void
Source
packages/blocks/src/surface-block/surface-model.ts:466
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:476
Generated using typedoc-plugin-markdown and TypeDoc