BlockSuite API Documentation / @blocksuite/blocks / TextElementModel
Class: TextElementModel 
Extends 
Constructors 
new TextElementModel() 
new TextElementModel(
options):TextElementModel
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
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/text/text.d.ts:18
connectable 
getconnectable():boolean
Returns 
boolean
Inherited from 
SurfaceElementModel.connectable
Defined in 
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:75
deserializedXYWH 
getdeserializedXYWH():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 
getelementBound():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 
getexternalBound():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
fontFamily 
Defined in 
packages/affine/model/dist/elements/text/text.d.ts:19
fontSize 
Defined in 
packages/affine/model/dist/elements/text/text.d.ts:20
fontStyle 
Defined in 
packages/affine/model/dist/elements/text/text.d.ts:21
fontWeight 
Defined in 
packages/affine/model/dist/elements/text/text.d.ts:22
group 
getgroup():null|SurfaceGroupLikeModel<BaseElementProps>
Returns 
null | SurfaceGroupLikeModel<BaseElementProps>
Inherited from 
Defined in 
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:83
groups 
getgroups():SurfaceGroupLikeModel<BaseElementProps>[]
Returns 
SurfaceGroupLikeModel<BaseElementProps>[]
Inherited from 
Defined in 
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:84
h 
geth():number
Returns 
number
Inherited from 
Defined in 
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:85
hasMaxWidth 
Defined in 
packages/affine/model/dist/elements/text/text.d.ts:23
id 
getid():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 
getisConnected():boolean
Returns 
boolean
Inherited from 
SurfaceElementModel.isConnected
Defined in 
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:87
opacity 
Inherited from 
Defined in 
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:117
rotate 
Overrides 
Defined in 
packages/affine/model/dist/elements/text/text.d.ts:24
seed 
Inherited from 
Defined in 
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:118
text 
Defined in 
packages/affine/model/dist/elements/text/text.d.ts:25
textAlign 
Defined in 
packages/affine/model/dist/elements/text/text.d.ts:26
type 
gettype():string
Returns 
string
Overrides 
Defined in 
packages/affine/model/dist/elements/text/text.d.ts:12
w 
getw():number
Returns 
number
Inherited from 
Defined in 
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:89
x 
getx():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/text/text.d.ts:27
y 
gety():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/text/text.d.ts:14
getLineIntersections() 
getLineIntersections(
start,end):null|PointLocation[]
Parameters 
• start: IVec
• end: IVec
Returns 
null | PointLocation[]
Overrides 
SurfaceElementModel.getLineIntersections
Defined in 
packages/affine/model/dist/elements/text/text.d.ts:15
getNearestPoint() 
getNearestPoint(
point):IVec
Parameters 
• point: IVec
Returns 
IVec
Overrides 
SurfaceElementModel.getNearestPoint
Defined in 
packages/affine/model/dist/elements/text/text.d.ts:16
getRelativePointLocation() 
getRelativePointLocation(
relativePoint):PointLocation
Parameters 
• relativePoint: IVec
Returns 
PointLocation
Inherited from 
SurfaceElementModel.getRelativePointLocation
Defined in 
packages/framework/block-std/dist/gfx/surface/element-model.d.ts:107
includesPoint() 
includesPoint(
x,y):boolean
Parameters 
• x: number
• y: number
Returns 
boolean
Overrides 
SurfaceElementModel.includesPoint
Defined in 
packages/affine/model/dist/elements/text/text.d.ts:17
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() 
staticpropsToY(props):Record<string,unknown>
Parameters 
• props: Record<string, unknown>
Returns 
Record<string, unknown>
Overrides 
Defined in 
packages/affine/model/dist/elements/text/text.d.ts:13