BlockSuite API Documentation / @blocksuite/blocks / ShapeElementModel
Class: ShapeElementModel
Contents
Extends
ElementModel
<ShapeProps
>
Constructors
new ShapeElementModel(options)
new ShapeElementModel(
options
):ShapeElementModel
Parameters
• options: Object
• options.model: SurfaceBlockModel
• options.onchange: (props
) => void
• options.stashedStore: Map
<unknown
, unknown
>
• options.yMap: Map
<unknown
>
Returns
Inherited from
ElementModel<ShapeProps>.constructor
Source
packages/blocks/src/surface-block/element-model/base.ts:36
Properties
_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:22
color?
color?:
string
Source
packages/blocks/src/surface-block/element-model/shape.ts:90
fillColor
fillColor:
string
='#ffffff'
Source
packages/blocks/src/surface-block/element-model/shape.ts:69
filled
filled:
boolean
=false
Source
packages/blocks/src/surface-block/element-model/shape.ts:66
fontFamily?
fontFamily?:
string
Source
packages/blocks/src/surface-block/element-model/shape.ts:96
fontSize?
fontSize?:
number
Source
packages/blocks/src/surface-block/element-model/shape.ts:93
fontStyle?
fontStyle?:
FontStyle
Source
packages/blocks/src/surface-block/element-model/shape.ts:102
fontWeight?
fontWeight?:
FontWeight
Source
packages/blocks/src/surface-block/element-model/shape.ts:99
index
index:
string
='a0'
Inherited from
ElementModel.index
Source
packages/blocks/src/surface-block/element-model/base.ts:34
radius
radius:
number
=0
Source
packages/blocks/src/surface-block/element-model/shape.ts:63
rotate
rotate:
number
=0
Overrides
ElementModel.rotate
Source
packages/blocks/src/surface-block/element-model/shape.ts:57
roughness
roughness:
number
=DEFAULT_ROUGHNESS
Source
packages/blocks/src/surface-block/element-model/shape.ts:84
shapeStyle
shapeStyle:
ShapeStyle
='General'
Source
packages/blocks/src/surface-block/element-model/shape.ts:81
shapeType
shapeType:
ShapeType
='rect'
Source
packages/blocks/src/surface-block/element-model/shape.ts:60
strokeColor
strokeColor:
string
='#000000'
Source
packages/blocks/src/surface-block/element-model/shape.ts:75
strokeStyle
strokeStyle:
StrokeStyle
='solid'
Source
packages/blocks/src/surface-block/element-model/shape.ts:78
strokeWidth
strokeWidth:
number
=4
Source
packages/blocks/src/surface-block/element-model/shape.ts:72
surfaceModel
surfaceModel:
SurfaceBlockModel
Inherited from
ElementModel.surfaceModel
Source
packages/blocks/src/surface-block/element-model/base.ts:25
text?
text?:
Text
Source
packages/blocks/src/surface-block/element-model/shape.ts:87
textAlign?
textAlign?:
"left"
|"right"
|"center"
Source
packages/blocks/src/surface-block/element-model/shape.ts:105
textHorizontalAlign?
textHorizontalAlign?:
"left"
|"right"
|"center"
Source
packages/blocks/src/surface-block/element-model/shape.ts:108
textVerticalAlign?
textVerticalAlign?:
"top"
|"bottom"
|"center"
Source
packages/blocks/src/surface-block/element-model/shape.ts:111
xywh
xywh: `[${number},${number},${number},${number}]` =
'[0,0,0,0]'
Overrides
ElementModel.xywh
Source
packages/blocks/src/surface-block/element-model/shape.ts:54
yMap
yMap:
Map
<unknown
>
Inherited from
ElementModel.yMap
Source
packages/blocks/src/surface-block/element-model/base.ts:24
Accessors
deserializedXYWH
get
deserializedXYWH():XYWH
Returns
XYWH
Source
packages/blocks/src/surface-block/element-model/base.ts:50
elementBound
get
elementBound():Bound
Returns
Source
packages/blocks/src/surface-block/element-model/base.ts:78
group
get
group():null
|GroupElementModel
Returns
null
| GroupElementModel
Source
packages/blocks/src/surface-block/element-model/base.ts:70
h
get
h():number
Returns
number
Source
packages/blocks/src/surface-block/element-model/base.ts:66
id
get
id():string
Returns
string
Source
packages/blocks/src/surface-block/element-model/base.ts:74
type
get
type():string
Returns
string
Source
packages/blocks/src/surface-block/element-model/shape.ts:113
w
get
w():number
Returns
number
Source
packages/blocks/src/surface-block/element-model/base.ts:62
x
get
x():number
Returns
number
Source
packages/blocks/src/surface-block/element-model/base.ts:54
y
get
y():number
Returns
number
Source
packages/blocks/src/surface-block/element-model/base.ts:58
Methods
pop()
pop(
prop
):void
Parameters
• prop: "text"
| "index"
| "color"
| "shapeStyle"
| "shapeType"
| "fillColor"
| "strokeColor"
| "strokeWidth"
| "radius"
| "filled"
| "strokeStyle"
| "roughness"
| "fontSize"
| "fontFamily"
| "fontWeight"
| "fontStyle"
| "textAlign"
| "textHorizontalAlign"
| "textVerticalAlign"
Returns
void
Inherited from
ElementModel.pop
Source
packages/blocks/src/surface-block/element-model/base.ts:94
stash()
stash(
prop
):void
Parameters
• prop: "text"
| "index"
| "color"
| "shapeStyle"
| "shapeType"
| "fillColor"
| "strokeColor"
| "strokeWidth"
| "radius"
| "filled"
| "strokeStyle"
| "roughness"
| "fontSize"
| "fontFamily"
| "fontWeight"
| "fontStyle"
| "textAlign"
| "textHorizontalAlign"
| "textVerticalAlign"
Returns
void
Inherited from
ElementModel.stash
Source
packages/blocks/src/surface-block/element-model/base.ts:86
propsToYStruct()
static
propsToYStruct(props
):ShapeProps
Parameters
• props: ShapeProps
Returns
ShapeProps
Overrides
ElementModel.propsToYStruct
Source
packages/blocks/src/surface-block/element-model/shape.ts:45
Generated using typedoc-plugin-markdown and TypeDoc