BlockSuite API Documentation / @blocksuite/blocks / ShapeElementModel
Class: ShapeElementModel
Extends
Constructors
new ShapeElementModel()
new ShapeElementModel(
options
):ShapeElementModel
Parameters
• options
• options.id: string
• options.model: SurfaceBlockModel
• options.onChange
• options.stashedStore: Map
<unknown
, unknown
>
• options.yMap: YMap
<unknown
>
Returns
Inherited from
SurfaceElementModel
.constructor
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:92
Properties
_disposable
protected
_disposable:DisposableGroup
Inherited from
SurfaceElementModel
._disposable
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:58
_id
protected
_id:string
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:59
_local
protected
_local:Map
<string
|symbol
,unknown
>
Inherited from
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
Inherited from
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.
Inherited from
SurfaceElementModel
._preserved
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:69
_stashed
protected
_stashed:Map
<string
,unknown
>
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:70
surface
surface:
SurfaceBlockModel
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:72
textBound
textBound:
null
|IBound
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:25
yMap
yMap:
YMap
<unknown
>
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:74
Accessors
color
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:33
connectable
get
connectable():boolean
Returns
boolean
Inherited from
SurfaceElementModel
.connectable
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:75
deserializedXYWH
get
deserializedXYWH():XYWH
Returns
XYWH
Inherited from
SurfaceElementModel
.deserializedXYWH
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:76
display
Inherited from
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
Inherited from
SurfaceElementModel
.elementBound
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:81
externalBound
get
externalBound():null
|Bound
Returns
null
| Bound
Inherited from
SurfaceElementModel
.externalBound
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:82
externalXYWH
Inherited from
SurfaceElementModel
.externalXYWH
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:115
fillColor
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:34
filled
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:35
fontFamily
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:36
fontSize
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:37
fontStyle
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:38
fontWeight
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:39
group
get
group():null
|SurfaceGroupLikeModel
<BaseElementProps
>
Returns
null
| SurfaceGroupLikeModel
<BaseElementProps
>
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:83
groups
get
groups():SurfaceGroupLikeModel
<BaseElementProps
>[]
Returns
SurfaceGroupLikeModel
<BaseElementProps
>[]
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:84
h
get
h():number
Returns
number
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:85
id
get
id():string
Returns
string
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:86
index
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:116
isConnected
get
isConnected():boolean
Returns
boolean
Inherited from
SurfaceElementModel
.isConnected
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:87
maxWidth
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:40
opacity
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:117
padding
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:41
radius
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:42
rotate
Overrides
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:43
roughness
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:44
seed
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:118
shadow
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:45
shapeStyle
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:51
shapeType
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:52
strokeColor
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:53
strokeStyle
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:54
strokeWidth
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:55
text
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:56
textAlign
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:57
textDisplay
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:58
textHorizontalAlign
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:59
textResizing
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:60
textVerticalAlign
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:61
type
get
type():string
Returns
string
Overrides
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:26
w
get
w():number
Returns
number
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:89
x
get
x():number
Returns
number
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:90
xywh
Overrides
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:62
y
get
y():number
Returns
number
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:91
Methods
containsBound()
containsBound(
bounds
):boolean
Parameters
• bounds: Bound
Returns
boolean
Overrides
SurfaceElementModel
.containsBound
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:28
getLineIntersections()
getLineIntersections(
start
,end
):null
|PointLocation
[]
Parameters
• start: IVec
• end: IVec
Returns
null
| PointLocation
[]
Overrides
SurfaceElementModel
.getLineIntersections
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:29
getNearestPoint()
getNearestPoint(
point
):IVec
Parameters
• point: IVec
Returns
IVec
Overrides
SurfaceElementModel
.getNearestPoint
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:30
getRelativePointLocation()
getRelativePointLocation(
point
):PointLocation
Parameters
• point: IVec
Returns
PointLocation
Overrides
SurfaceElementModel
.getRelativePointLocation
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:31
includesPoint()
includesPoint(
x
,y
,options
):boolean
Parameters
• x: number
• y: number
• options: PointTestOptions
Returns
boolean
Overrides
SurfaceElementModel
.includesPoint
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:32
intersectsBound()
intersectsBound(
bound
):boolean
Parameters
• bound: Bound
Returns
boolean
Inherited from
SurfaceElementModel
.intersectsBound
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:109
onCreated()
onCreated():
void
Returns
void
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:110
pop()
pop(
prop
):void
Parameters
• prop: string
Returns
void
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:111
serialize()
serialize():
SerializedElement
Returns
SerializedElement
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:112
stash()
stash(
prop
):void
Parameters
• prop: string
Returns
void
Inherited from
Defined in
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:113
propsToY()
static
propsToY(props
):ShapeProps
Parameters
• props: ShapeProps
Returns
Overrides
Defined in
packages/affine/model/dist/elements/shape/shape.d.ts:27