BlockSuite API Documentation / @blocksuite/blocks / SurfaceElementModel
Class: abstract
SurfaceElementModel<Props>
Extended by
Type Parameters
• Props extends BaseElementProps
= BaseElementProps
Implements
GfxElementGeometry
Constructors
new SurfaceElementModel()
new SurfaceElementModel<
Props
>(options
):SurfaceElementModel
<Props
>
Parameters
• options
• options.id: string
• options.model: SurfaceBlockModel
• options.onChange
• options.stashedStore: Map
<unknown
, unknown
>
• options.yMap: YMap
<unknown
>
Returns
SurfaceElementModel
<Props
>
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:92
Properties
_disposable
protected
_disposable:DisposableGroup
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:58
_id
protected
_id:string
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:59
_local
protected
_local:Map
<string
|symbol
,unknown
>
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:60
_onChange()
protected
_onChange: (payload
) =>void
Parameters
• payload
• payload.local: boolean
• payload.oldValues: Record
<string
, unknown
>
• payload.props: Record
<string
, unknown
>
Returns
void
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:61
_preserved
protected
_preserved:Map
<string
,unknown
>
Used to store a copy of data in the yMap.
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:69
_stashed
protected
_stashed:Map
<string
| keyofProps
,unknown
>
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:70
rotate
abstract
rotate:number
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:71
surface
surface:
SurfaceBlockModel
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:72
xywh
abstract
xywh: `[${number},${number},${number},${number}]`
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:73
yMap
yMap:
YMap
<unknown
>
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:74
Accessors
connectable
get
connectable():boolean
Returns
boolean
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:75
deserializedXYWH
get
deserializedXYWH():XYWH
Returns
XYWH
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:76
display
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:114
elementBound
get
elementBound():Bound
The bound of the element after rotation. The bound without rotation should be created by Bound.deserialize(this.xywh)
.
Returns
Bound
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:81
externalBound
get
externalBound():null
|Bound
Returns
null
| Bound
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:82
externalXYWH
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:115
group
get
group():null
|SurfaceGroupLikeModel
<BaseElementProps
>
Returns
null
| SurfaceGroupLikeModel
<BaseElementProps
>
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:83
groups
get
groups():SurfaceGroupLikeModel
<BaseElementProps
>[]
Returns
SurfaceGroupLikeModel
<BaseElementProps
>[]
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:84
h
get
h():number
Returns
number
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:85
id
get
id():string
Returns
string
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:86
index
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:116
isConnected
get
isConnected():boolean
Returns
boolean
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:87
opacity
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:117
seed
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:118
type
get
abstract
type():string
Returns
string
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:88
w
get
w():number
Returns
number
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:89
x
get
x():number
Returns
number
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:90
y
get
y():number
Returns
number
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:91
Methods
containsBound()
containsBound(
bounds
):boolean
Parameters
• bounds: Bound
Returns
boolean
Implementation of
GfxElementGeometry.containsBound
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:104
getLineIntersections()
getLineIntersections(
start
,end
):null
|PointLocation
[]
Parameters
• start: IVec
• end: IVec
Returns
null
| PointLocation
[]
Implementation of
GfxElementGeometry.getLineIntersections
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:105
getNearestPoint()
getNearestPoint(
point
):IVec
Parameters
• point: IVec
Returns
IVec
Implementation of
GfxElementGeometry.getNearestPoint
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:106
getRelativePointLocation()
getRelativePointLocation(
relativePoint
):PointLocation
Parameters
• relativePoint: IVec
Returns
PointLocation
Implementation of
GfxElementGeometry.getRelativePointLocation
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:107
includesPoint()
includesPoint(
x
,y
,_
,__
):boolean
Parameters
• x: number
• y: number
• _: PointTestOptions
• __: EditorHost
Returns
boolean
Implementation of
GfxElementGeometry.includesPoint
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:108
intersectsBound()
intersectsBound(
bound
):boolean
Parameters
• bound: Bound
Returns
boolean
Implementation of
GfxElementGeometry.intersectsBound
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:109
onCreated()
onCreated():
void
Returns
void
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:110
pop()
pop(
prop
):void
Parameters
• prop: string
| keyof Props
Returns
void
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:111
serialize()
serialize():
SerializedElement
Returns
SerializedElement
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:112
stash()
stash(
prop
):void
Parameters
• prop: string
| keyof Props
Returns
void
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:113
propsToY()
static
propsToY(props
):Record
<string
,unknown
>
Parameters
• props: Record
<string
, unknown
>
Returns
Record
<string
, unknown
>
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:103