BlockSuite API Documentation / @blocksuite/blocks / BrushElementModel
Class: BrushElementModel
Extends
ElementModel
<BrushProps
>
Contents
Constructors
new BrushElementModel(options)
new BrushElementModel(
options
):BrushElementModel
Parameters
• options: Object
• options.model: SurfaceBlockModel
• options.onChange: (props
) => void
• options.stashedStore: Map
<unknown
, unknown
>
• options.yMap: Map
<unknown
>
Returns
Inherited from
ElementModel<BrushProps>.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
<"index"
|"color"
|"lineWidth"
|"points"
,unknown
>
Inherited from
ElementModel._stashed
Source
packages/blocks/src/surface-block/element-model/base.ts:23
color
color:
string
='#000000'
Source
packages/blocks/src/surface-block/element-model/brush.ts:55
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
lineWidth
lineWidth:
number
=4
Source
packages/blocks/src/surface-block/element-model/brush.ts:58
opacity
opacity:
number
=1
Inherited from
ElementModel.opacity
Source
packages/blocks/src/surface-block/element-model/base.ts:43
points
points:
number
[][] =[]
Source
packages/blocks/src/surface-block/element-model/brush.ts:31
rotate
rotate:
number
=0
Overrides
ElementModel.rotate
Source
packages/blocks/src/surface-block/element-model/brush.ts:52
surfaceModel
surfaceModel:
SurfaceBlockModel
Inherited from
ElementModel.surfaceModel
Source
packages/blocks/src/surface-block/element-model/base.ts:28
xywh
xywh: `[${number},${number},${number},${number}]` =
'[0,0,0,0]'
Overrides
ElementModel.xywh
Source
packages/blocks/src/surface-block/element-model/brush.ts:49
yMap
yMap:
Map
<unknown
>
Inherited from
ElementModel.yMap
Source
packages/blocks/src/surface-block/element-model/base.ts:27
Accessors
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
type
get
type():string
Returns
string
Source
packages/blocks/src/surface-block/element-model/brush.ts:60
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
y
get
y():number
Returns
number
Source
packages/blocks/src/surface-block/element-model/base.ts:71
Methods
pop()
pop(
prop
):void
Parameters
• prop: "index"
| "color"
| "lineWidth"
| "points"
Returns
void
Inherited from
ElementModel.pop
Source
packages/blocks/src/surface-block/element-model/base.ts:124
stash()
stash(
prop
):void
Parameters
• prop: "index"
| "color"
| "lineWidth"
| "points"
Returns
void
Inherited from
ElementModel.stash
Source
packages/blocks/src/surface-block/element-model/base.ts:99
propsToY()
static
propsToY(props
):Record
<string
,unknown
>
Parameters
• props: Record
<string
, unknown
>
Returns
Record
<string
, unknown
>
Inherited from
ElementModel.propsToY
Source
packages/blocks/src/surface-block/element-model/base.ts:14
Generated using typedoc-plugin-markdown and TypeDoc