Skip to content

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

TextElementModel

Inherited from

GfxPrimitiveElementModel<TextElementProps>.constructor

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:68

Properties

_disposable

protected _disposable: DisposableGroup

Inherited from

GfxPrimitiveElementModel._disposable

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:52


_id

protected _id: string

Inherited from

GfxPrimitiveElementModel._id

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:53


_local

protected _local: Map<string | symbol, unknown>

Inherited from

GfxPrimitiveElementModel._local

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:55


_onChange()

protected _onChange: (payload) => void

Parameters

payload

payload.local: boolean

payload.oldValues: Record<string, unknown>

payload.props: Record<string, unknown>

Returns

void

Inherited from

GfxPrimitiveElementModel._onChange

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:56


_preserved

protected _preserved: Map<string, unknown>

Used to store a copy of data in the yMap.

Inherited from

GfxPrimitiveElementModel._preserved

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:64


_stashed

protected _stashed: Map<string, unknown>

Inherited from

GfxPrimitiveElementModel._stashed

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:65


surface

surface: SurfaceBlockModel

Inherited from

GfxPrimitiveElementModel.surface

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:66


yMap

yMap: YMap<unknown>

Inherited from

GfxPrimitiveElementModel.yMap

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:67

Accessors

color

Defined in

packages/affine/model/dist/elements/text/text.d.ts:18


connectable

get connectable(): boolean

Returns

boolean

Inherited from

GfxPrimitiveElementModel.connectable

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:90


deserializedXYWH

get deserializedXYWH(): XYWH

Returns

XYWH

Inherited from

GfxPrimitiveElementModel.deserializedXYWH

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:91


display

Inherited from

GfxPrimitiveElementModel.display

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:106


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

GfxPrimitiveElementModel.elementBound

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:96


externalBound

get externalBound(): null | Bound

Returns

null | Bound

Inherited from

GfxPrimitiveElementModel.externalBound

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:97


externalXYWH

Inherited from

GfxPrimitiveElementModel.externalXYWH

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:107


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

get group(): null | GfxGroupLikeElementModel<BaseElementProps>

Returns

null | GfxGroupLikeElementModel<BaseElementProps>

Inherited from

GfxPrimitiveElementModel.group

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:98


groups

get groups(): GfxGroupLikeElementModel<BaseElementProps>[]

Returns

GfxGroupLikeElementModel<BaseElementProps>[]

Inherited from

GfxPrimitiveElementModel.groups

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:99


h

get h(): number

Returns

number

Inherited from

GfxPrimitiveElementModel.h

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:100


hasMaxWidth

Defined in

packages/affine/model/dist/elements/text/text.d.ts:23


id

get id(): string

Returns

string

Inherited from

GfxPrimitiveElementModel.id

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:101


index

Inherited from

GfxPrimitiveElementModel.index

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:108


isConnected

get isConnected(): boolean

Returns

boolean

Inherited from

GfxPrimitiveElementModel.isConnected

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:102


opacity

Inherited from

GfxPrimitiveElementModel.opacity

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:109


rotate

Overrides

GfxPrimitiveElementModel.rotate

Defined in

packages/affine/model/dist/elements/text/text.d.ts:24


seed

Inherited from

GfxPrimitiveElementModel.seed

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:111


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

get type(): string

Returns

string

Overrides

GfxPrimitiveElementModel.type

Defined in

packages/affine/model/dist/elements/text/text.d.ts:17


w

get w(): number

Returns

number

Inherited from

GfxPrimitiveElementModel.w

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:103


x

get x(): number

Returns

number

Inherited from

GfxPrimitiveElementModel.x

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:104


xywh

Overrides

GfxPrimitiveElementModel.xywh

Defined in

packages/affine/model/dist/elements/text/text.d.ts:27


y

get y(): number

Returns

number

Inherited from

GfxPrimitiveElementModel.y

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:105

Methods

containsBound()

containsBound(bounds): boolean

Parameters

bounds: Bound

Returns

boolean

Overrides

GfxPrimitiveElementModel.containsBound

Defined in

packages/affine/model/dist/elements/text/text.d.ts:13


getLineIntersections()

getLineIntersections(start, end): null | PointLocation[]

Parameters

start: IVec

end: IVec

Returns

null | PointLocation[]

Overrides

GfxPrimitiveElementModel.getLineIntersections

Defined in

packages/affine/model/dist/elements/text/text.d.ts:14


getNearestPoint()

getNearestPoint(point): IVec

Parameters

point: IVec

Returns

IVec

Overrides

GfxPrimitiveElementModel.getNearestPoint

Defined in

packages/affine/model/dist/elements/text/text.d.ts:15


getRelativePointLocation()

getRelativePointLocation(relativePoint): PointLocation

Parameters

relativePoint: IVec

Returns

PointLocation

Inherited from

GfxPrimitiveElementModel.getRelativePointLocation

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:83


includesPoint()

includesPoint(x, y): boolean

Parameters

x: number

y: number

Returns

boolean

Overrides

GfxPrimitiveElementModel.includesPoint

Defined in

packages/affine/model/dist/elements/text/text.d.ts:16


intersectsBound()

intersectsBound(bound): boolean

Parameters

bound: Bound

Returns

boolean

Inherited from

GfxPrimitiveElementModel.intersectsBound

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:85


onCreated()

onCreated(): void

Returns

void

Inherited from

GfxPrimitiveElementModel.onCreated

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:86


pop()

pop(prop): void

Parameters

prop: string

Returns

void

Inherited from

GfxPrimitiveElementModel.pop

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:87


serialize()

serialize(): SerializedElement

Returns

SerializedElement

Inherited from

GfxPrimitiveElementModel.serialize

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:88


stash()

stash(prop): void

Parameters

prop: string

Returns

void

Inherited from

GfxPrimitiveElementModel.stash

Defined in

packages/framework/block-std/dist/gfx/surface/element-model.d.ts:89


propsToY()

static propsToY(props): Record<string, unknown>

Parameters

props: Record<string, unknown>

Returns

Record<string, unknown>

Overrides

GfxPrimitiveElementModel.propsToY

Defined in

packages/affine/model/dist/elements/text/text.d.ts:12