BlockSuite API Documentation / @blocksuite/blocks / ConnectorElementModel
Class: ConnectorElementModel
Extends
ElementModel
<ConnectorElementProps
>
Constructors
new ConnectorElementModel(options)
new ConnectorElementModel(
options
):ConnectorElementModel
Parameters
• options: Object
• options.model: SurfaceBlockModel
• options.onChange: (payload
) => void
• options.stashedStore: Map
<unknown
, unknown
>
• options.yMap: Map
<unknown
>
Returns
Inherited from
@blocksuite/blocks.ElementModel.constructor
Source
packages/blocks/src/surface-block/element-model/base.ts:96
Properties
_local
protected
_local:Map
<string
|symbol
,unknown
>
Inherited from
@blocksuite/blocks.ElementModel._local
Source
packages/blocks/src/surface-block/element-model/base.ts:61
_observerDisposable
protected
_observerDisposable:Record
<string
|symbol
, () =>void
> ={}
Inherited from
@blocksuite/blocks.ElementModel._observerDisposable
Source
packages/blocks/src/surface-block/element-model/base.ts:66
_onChange
protected
_onChange: (payload
) =>void
Parameters
• payload: Object
• payload.oldValues: Record
<string
, unknown
>
• payload.props: Record
<string
, unknown
>
Returns
void
Inherited from
@blocksuite/blocks.ElementModel._onChange
Source
packages/blocks/src/surface-block/element-model/base.ts:62
_preserved
protected
_preserved:Map
<string
,unknown
>
When the ymap is not connected to the doc, its value cannot be read. But we need to use those value during the creation, so the yfied decorated field's value will be stored in this map too during the creation.
After the ymap is connected to the doc, this map will be cleared.
Inherited from
@blocksuite/blocks.ElementModel._preserved
Source
packages/blocks/src/surface-block/element-model/base.ts:59
_stashed
protected
_stashed:Map
<string
,unknown
>
Inherited from
@blocksuite/blocks.ElementModel._stashed
Source
packages/blocks/src/surface-block/element-model/base.ts:60
absolutePath
absolutePath:
PointLocation
[] =[]
Source
packages/blocks/src/surface-block/element-model/connector.ts:67
display
display:
boolean
=true
Inherited from
@blocksuite/blocks.ElementModel.display
Source
packages/blocks/src/surface-block/element-model/base.ts:84
externalXYWH
externalXYWH:
undefined
| `[${number},${number},${number},${number}]` =undefined
Inherited from
@blocksuite/blocks.ElementModel.externalXYWH
Source
packages/blocks/src/surface-block/element-model/base.ts:90
frontEndpointStyle
frontEndpointStyle:
PointStyle
Source
packages/blocks/src/surface-block/element-model/connector.ts:104
index
index:
string
Inherited from
@blocksuite/blocks.ElementModel.index
Source
packages/blocks/src/surface-block/element-model/base.ts:78
mode
mode:
ConnectorMode
=ConnectorMode.Orthogonal
Source
packages/blocks/src/surface-block/element-model/connector.ts:76
opacity
opacity:
number
=1
Inherited from
@blocksuite/blocks.ElementModel.opacity
Source
packages/blocks/src/surface-block/element-model/base.ts:87
path
path:
PointLocation
[] =[]
Source
packages/blocks/src/surface-block/element-model/connector.ts:64
rearEndpointStyle
rearEndpointStyle:
PointStyle
Source
packages/blocks/src/surface-block/element-model/connector.ts:107
rotate
rotate:
number
=0
Overrides
@blocksuite/blocks.ElementModel.rotate
Source
packages/blocks/src/surface-block/element-model/connector.ts:73
rough?
rough?:
boolean
Source
packages/blocks/src/surface-block/element-model/connector.ts:91
roughness
roughness:
number
=DEFAULT_ROUGHNESS
Source
packages/blocks/src/surface-block/element-model/connector.ts:88
seed
seed:
number
Inherited from
@blocksuite/blocks.ElementModel.seed
Source
packages/blocks/src/surface-block/element-model/base.ts:81
source
source:
Connection
Source
packages/blocks/src/surface-block/element-model/connector.ts:94
stroke
stroke:
string
='#000000'
Source
packages/blocks/src/surface-block/element-model/connector.ts:82
strokeStyle
strokeStyle:
StrokeStyle
='solid'
Source
packages/blocks/src/surface-block/element-model/connector.ts:85
strokeWidth
strokeWidth:
number
=4
Source
packages/blocks/src/surface-block/element-model/connector.ts:79
surface
surface:
SurfaceBlockModel
Inherited from
@blocksuite/blocks.ElementModel.surface
Source
packages/blocks/src/surface-block/element-model/base.ts:69
target
target:
Connection
Source
packages/blocks/src/surface-block/element-model/connector.ts:99
updatingPath
updatingPath:
boolean
=false
Source
packages/blocks/src/surface-block/element-model/connector.ts:45
xywh
xywh: `[${number},${number},${number},${number}]` =
'[0,0,0,0]'
Overrides
@blocksuite/blocks.ElementModel.xywh
Source
packages/blocks/src/surface-block/element-model/connector.ts:70
yMap
yMap:
Map
<unknown
>
Inherited from
@blocksuite/blocks.ElementModel.yMap
Source
packages/blocks/src/surface-block/element-model/base.ts:68
Accessors
connectable
get
connectable():false
Returns
false
Source
packages/blocks/src/surface-block/element-model/connector.ts:52
deserializedXYWH
get
deserializedXYWH():XYWH
Returns
XYWH
Source
packages/blocks/src/surface-block/element-model/base.ts:122
elementBound
get
elementBound():Bound
Returns
Source
packages/blocks/src/surface-block/element-model/base.ts:154
externalBound
get
externalBound():null
|Bound
Returns
null
| Bound
Source
packages/blocks/src/surface-block/element-model/base.ts:92
group
get
group():null
|GroupElementModel
Returns
null
| GroupElementModel
Source
packages/blocks/src/surface-block/element-model/base.ts:142
groups
get
groups():GroupElementModel
[]
Returns
Source
packages/blocks/src/surface-block/element-model/base.ts:146
h
get
h():number
Returns
number
Source
packages/blocks/src/surface-block/element-model/base.ts:138
id
get
id():string
Returns
string
Source
packages/blocks/src/surface-block/element-model/base.ts:150
type
get
type():string
Returns
string
Source
packages/blocks/src/surface-block/element-model/connector.ts:47
w
get
w():number
Returns
number
Source
packages/blocks/src/surface-block/element-model/base.ts:134
x
get
x():number
Returns
number
Source
packages/blocks/src/surface-block/element-model/base.ts:126
y
get
y():number
Returns
number
Source
packages/blocks/src/surface-block/element-model/base.ts:130
Methods
boxSelect()
boxSelect(
bound
):boolean
Parameters
• bound: Bound
Returns
boolean
Inherited from
@blocksuite/blocks.ElementModel.boxSelect
Source
packages/blocks/src/surface-block/element-model/base.ts:250
containedByBounds()
containedByBounds(
bounds
):boolean
Parameters
• bounds: Bound
Returns
boolean
Overrides
@blocksuite/blocks.ElementModel.containedByBounds
Source
packages/blocks/src/surface-block/element-model/connector.ts:142
getNearestPoint()
getNearestPoint(
point
):IVec2
Parameters
• point: IVec2
Returns
IVec2
Overrides
@blocksuite/blocks.ElementModel.getNearestPoint
Source
packages/blocks/src/surface-block/element-model/connector.ts:146
getRelativePointLocation()
getRelativePointLocation(
point
):PointLocation
Parameters
• point: IVec2
Returns
PointLocation
Overrides
@blocksuite/blocks.ElementModel.getRelativePointLocation
Source
packages/blocks/src/surface-block/element-model/connector.ts:154
hitTest()
hitTest(
x
,y
,options
?):boolean
Parameters
• x: number
• y: number
• options?: HitTestOptions
Returns
boolean
Overrides
@blocksuite/blocks.ElementModel.hitTest
Source
packages/blocks/src/surface-block/element-model/connector.ts:127
intersectWithLine()
intersectWithLine(
start
,end
):null
|PointLocation
[]
Parameters
• start: IVec2
• end: IVec2
Returns
null
| PointLocation
[]
Overrides
@blocksuite/blocks.ElementModel.intersectWithLine
Source
packages/blocks/src/surface-block/element-model/connector.ts:150
moveTo()
moveTo(
bound
):void
Parameters
• bound: Bound
Returns
void
Source
packages/blocks/src/surface-block/element-model/connector.ts:109
pop()
pop(
prop
):void
Parameters
• prop: string
Returns
void
Inherited from
@blocksuite/blocks.ElementModel.pop
Source
packages/blocks/src/surface-block/element-model/base.ts:201
serialize()
serialize():
Object
Returns
Object
Overrides
@blocksuite/blocks.ElementModel.serialize
Source
packages/blocks/src/surface-block/element-model/connector.ts:160
stash()
stash(
prop
):void
Parameters
• prop: string
Returns
void
Inherited from
@blocksuite/blocks.ElementModel.stash
Source
packages/blocks/src/surface-block/element-model/base.ts:162
propsToY()
static
propsToY(props
):Record
<string
,unknown
>
Parameters
• props: Record
<string
, unknown
>
Returns
Record
<string
, unknown
>
Inherited from
@blocksuite/blocks.ElementModel.propsToY
Source
packages/blocks/src/surface-block/element-model/base.ts:48
Generated using TypeDoc and typedoc-plugin-markdown.