BlockSuite API Documentation / @blocksuite/blocks / GroupElementModel
Class: GroupElementModel
Extends
ElementModel
<GroupElementProps
>
Contents
Constructors
new GroupElementModel(options)
new GroupElementModel(
options
):GroupElementModel
Parameters
• options: Object
• options.model: SurfaceBlockModel
• options.onChange: (props
) => void
• options.stashedStore: Map
<unknown
, unknown
>
• options.yMap: Map
<unknown
>
Returns
Inherited from
ElementModel<GroupElementProps>.constructor
Source
packages/blocks/src/surface-block/element-model/base.ts:45
Properties
_local
protected
_local:Map
<string
|symbol
,unknown
>
Inherited from
ElementModel._local
Source
packages/blocks/src/surface-block/element-model/base.ts:24
_onChange
protected
_onChange: (props
) =>void
Parameters
• props: Record
<string
, Object
>
Returns
void
Inherited from
ElementModel._onChange
Source
packages/blocks/src/surface-block/element-model/base.ts:25
_preserved
protected
_preserved:Map
<string
,unknown
>
When the ymap is not connected to the doc, the value cannot be accessed. But sometimes we need to access the value when creating the element model, those temporary values are stored here.
Inherited from
ElementModel._preserved
Source
packages/blocks/src/surface-block/element-model/base.ts:22
_stashed
protected
_stashed:Map
<"children"
|"title"
|"index"
,unknown
>
Inherited from
ElementModel._stashed
Source
packages/blocks/src/surface-block/element-model/base.ts:23
children
children:
Map
<boolean
>
Source
packages/blocks/src/surface-block/element-model/group.ts:36
display
display:
boolean
=true
Inherited from
ElementModel.display
Source
packages/blocks/src/surface-block/element-model/base.ts:40
index
index:
string
Inherited from
ElementModel.index
Source
packages/blocks/src/surface-block/element-model/base.ts:37
opacity
opacity:
number
=1
Inherited from
ElementModel.opacity
Source
packages/blocks/src/surface-block/element-model/base.ts:43
surfaceModel
surfaceModel:
SurfaceBlockModel
Inherited from
ElementModel.surfaceModel
Source
packages/blocks/src/surface-block/element-model/base.ts:28
title
title:
Text
Source
packages/blocks/src/surface-block/element-model/group.ts:39
yMap
yMap:
Map
<unknown
>
Inherited from
ElementModel.yMap
Source
packages/blocks/src/surface-block/element-model/base.ts:27
Accessors
childrenElements
get
childrenElements(): (BlockModel
<object
> |ElementModel
<BaseProps
>)[]
Returns
(BlockModel
<object
> | ElementModel
<BaseProps
>)[]
Source
packages/blocks/src/surface-block/element-model/group.ts:79
childrenIds
get
childrenIds():string
[]
Returns
string
[]
Source
packages/blocks/src/surface-block/element-model/group.ts:75
deserializedXYWH
get
deserializedXYWH():XYWH
Returns
XYWH
Source
packages/blocks/src/surface-block/element-model/base.ts:63
elementBound
get
elementBound():Bound
Returns
Source
packages/blocks/src/surface-block/element-model/base.ts:91
group
get
group():null
|GroupElementModel
Returns
null
| GroupElementModel
Source
packages/blocks/src/surface-block/element-model/base.ts:83
h
get
h():number
Returns
number
Source
packages/blocks/src/surface-block/element-model/base.ts:79
id
get
id():string
Returns
string
Source
packages/blocks/src/surface-block/element-model/base.ts:87
rotate
get
rotate():number
set
rotate(_
):void
Parameters
• _: number
Returns
number
Source
packages/blocks/src/surface-block/element-model/group.ts:65
type
get
type():string
Returns
string
Source
packages/blocks/src/surface-block/element-model/group.ts:71
w
get
w():number
Returns
number
Source
packages/blocks/src/surface-block/element-model/base.ts:75
x
get
x():number
Returns
number
Source
packages/blocks/src/surface-block/element-model/base.ts:67
xywh
get
xywh(): `[${number},${number},${number},${number}]`
set
xywh(_
):void
Parameters
• _: `[${number},${number},${number},${number}]`
Returns
`[${number},${number},${number},${number}]`
Source
packages/blocks/src/surface-block/element-model/group.ts:41
y
get
y():number
Returns
number
Source
packages/blocks/src/surface-block/element-model/base.ts:71
Methods
pop()
pop(
prop
):void
Parameters
• prop: "children"
| "title"
| "index"
Returns
void
Inherited from
ElementModel.pop
Source
packages/blocks/src/surface-block/element-model/base.ts:124
stash()
stash(
prop
):void
Parameters
• prop: "children"
| "title"
| "index"
Returns
void
Inherited from
ElementModel.stash
Source
packages/blocks/src/surface-block/element-model/base.ts:99
propsToY()
static
propsToY(props
):GroupElementProps
Parameters
• props: GroupElementProps
Returns
GroupElementProps
Overrides
ElementModel.propsToY
Source
packages/blocks/src/surface-block/element-model/group.ts:17
Generated using typedoc-plugin-markdown and TypeDoc