BlockSuite API Documentation / @blocksuite/blocks / BrushElementModel
Class: BrushElementModel
Extends
Constructors
new BrushElementModel()
new BrushElementModel(
options
):BrushElementModel
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/model/surface/element-model.d.ts:56
Properties
_disposable
protected
_disposable:DisposableGroup
Inherited from
SurfaceElementModel
._disposable
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:22
_id
protected
_id:string
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:23
_local
protected
_local:Map
<string
|symbol
,unknown
>
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:24
_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/model/surface/element-model.d.ts:25
_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/model/surface/element-model.d.ts:33
_stashed
protected
_stashed:Map
<string
,unknown
>
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:34
surface
surface:
SurfaceBlockModel
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:36
yMap
yMap:
YMap
<unknown
>
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:38
Accessors
color
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:27
commands
get
commands():string
The SVG path commands for the brush.
Returns
string
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:18
connectable
get
connectable():boolean
Returns
boolean
Overrides
SurfaceElementModel
.connectable
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:19
deserializedXYWH
get
deserializedXYWH():XYWH
Returns
XYWH
Inherited from
SurfaceElementModel
.deserializedXYWH
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:40
display
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:78
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/model/surface/element-model.d.ts:45
externalBound
get
externalBound():null
|Bound
Returns
null
| Bound
Inherited from
SurfaceElementModel
.externalBound
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:46
externalXYWH
Inherited from
SurfaceElementModel
.externalXYWH
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:79
group
get
group():null
|GfxGroupModel
Returns
null
| GfxGroupModel
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:47
groups
get
groups():GfxGroupModel
[]
Returns
GfxGroupModel
[]
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:48
h
get
h():number
Returns
number
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:49
id
get
id():string
Returns
string
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:50
index
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:80
isConnected
get
isConnected():boolean
Returns
boolean
Inherited from
SurfaceElementModel
.isConnected
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:51
lineWidth
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:28
opacity
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:81
points
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:29
rotate
Overrides
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:30
seed
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:82
type
get
type():string
Returns
string
Overrides
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:20
w
get
w():number
Returns
number
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:53
x
get
x():number
Returns
number
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:54
xywh
Overrides
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:31
y
get
y():number
Returns
number
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:55
Methods
containsBound()
containsBound(
bounds
):boolean
Parameters
• bounds: Bound
Returns
boolean
Overrides
SurfaceElementModel
.containsBound
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:22
getLineIntersections()
getLineIntersections(
start
,end
):null
|PointLocation
[]
Parameters
• start: IVec
• end: IVec
Returns
null
| PointLocation
[]
Overrides
SurfaceElementModel
.getLineIntersections
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:23
getNearestPoint()
getNearestPoint(
point
):IVec
Parameters
• point: IVec
Returns
IVec
Overrides
SurfaceElementModel
.getNearestPoint
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:24
getRelativePointLocation()
getRelativePointLocation(
position
):PointLocation
Parameters
• position: IVec
Returns
PointLocation
Overrides
SurfaceElementModel
.getRelativePointLocation
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:25
includesPoint()
includesPoint(
px
,py
,options
?):boolean
Parameters
• px: number
• py: number
• options?: PointTestOptions
Returns
boolean
Overrides
SurfaceElementModel
.includesPoint
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:26
intersectsBound()
intersectsBound(
bound
):boolean
Parameters
• bound: Bound
Returns
boolean
Inherited from
SurfaceElementModel
.intersectsBound
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:73
onCreated()
onCreated():
void
Returns
void
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:74
pop()
pop(
prop
):void
Parameters
• prop: string
Returns
void
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:75
serialize()
serialize():
SerializedElement
Returns
SerializedElement
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:76
stash()
stash(
prop
):void
Parameters
• prop: string
Returns
void
Inherited from
Defined in
packages/framework/block-std/dist/gfx/model/surface/element-model.d.ts:77
propsToY()
static
propsToY(props
):BrushProps
Parameters
• props: BrushProps
Returns
Overrides
Defined in
packages/affine/model/dist/elements/brush/brush.d.ts:21