@univerjs/docs-ui v0.4.2 • Docs
Class: TextRange
Implements
Constructors
new TextRange()
new TextRange(
_scene,
_document,
_docSkeleton,
anchorNodePosition?,
focusNodePosition?,
style?,
_segmentId?,
_segmentPage?): TextRange
Parameters
Parameter | Type | Default value |
---|---|---|
_scene | ThinScene | undefined |
_document | Documents | undefined |
_docSkeleton | DocumentSkeleton | undefined |
anchorNodePosition ? | Nullable <INodePosition > | undefined |
focusNodePosition ? | Nullable <INodePosition > | undefined |
style ? | ITextSelectionStyle | NORMAL_TEXT_SELECTION_PLUGIN_STYLE |
_segmentId ? | string | '' |
_segmentPage ? | number | -1 |
Returns
Defined in
packages/docs-ui/src/services/selection/text-range.ts:108 (opens in a new tab)
Properties
Property | Modifier | Type | Default value | Defined in |
---|---|---|---|---|
anchorNodePosition? | public | Nullable <INodePosition > | undefined | packages/docs-ui/src/services/selection/text-range.ts:112 (opens in a new tab) |
focusNodePosition? | public | Nullable <INodePosition > | undefined | packages/docs-ui/src/services/selection/text-range.ts:113 (opens in a new tab) |
rangeType | public | DOC_RANGE_TYPE | DOC_RANGE_TYPE.TEXT | packages/docs-ui/src/services/selection/text-range.ts:96 (opens in a new tab) |
style | public | ITextSelectionStyle | NORMAL_TEXT_SELECTION_PLUGIN_STYLE | packages/docs-ui/src/services/selection/text-range.ts:114 (opens in a new tab) |
Accessors
collapsed
get collapsed(): boolean
Returns
boolean
Implementation of
Defined in
packages/docs-ui/src/services/selection/text-range.ts:181 (opens in a new tab)
direction
get direction(): RANGE_DIRECTION
Returns
Implementation of
Defined in
packages/docs-ui/src/services/selection/text-range.ts:215 (opens in a new tab)
endNodePosition
get endNodePosition(): Nullable<INodePosition>
Returns
Implementation of
Defined in
packages/docs-ui/src/services/selection/text-range.ts:201 (opens in a new tab)
endOffset
get endOffset(): undefined | number
Returns
undefined
| number
Implementation of
Defined in
packages/docs-ui/src/services/selection/text-range.ts:164 (opens in a new tab)
segmentId
get segmentId(): string
Returns
string
Implementation of
Defined in
packages/docs-ui/src/services/selection/text-range.ts:227 (opens in a new tab)
segmentPage
get segmentPage(): number
Returns
number
Implementation of
Defined in
packages/docs-ui/src/services/selection/text-range.ts:231 (opens in a new tab)
startNodePosition
get startNodePosition(): null | INodePosition
Returns
null
| INodePosition
Implementation of
Defined in
packages/docs-ui/src/services/selection/text-range.ts:187 (opens in a new tab)
startOffset
get startOffset(): undefined | number
Returns
undefined
| number
Implementation of
Defined in
packages/docs-ui/src/services/selection/text-range.ts:146 (opens in a new tab)
Methods
activate()
activate(): void
Returns
void
Defined in
packages/docs-ui/src/services/selection/text-range.ts:302 (opens in a new tab)
activeStatic()
activeStatic(): void
Returns
void
Defined in
packages/docs-ui/src/services/selection/text-range.ts:286 (opens in a new tab)
deactivate()
deactivate(): void
Returns
void
Defined in
packages/docs-ui/src/services/selection/text-range.ts:306 (opens in a new tab)
deactivateStatic()
deactivateStatic(): void
Returns
void
Defined in
packages/docs-ui/src/services/selection/text-range.ts:292 (opens in a new tab)
dispose()
dispose(): void
Returns
void
Implementation of
Defined in
packages/docs-ui/src/services/selection/text-range.ts:310 (opens in a new tab)
getAbsolutePosition()
getAbsolutePosition(): undefined | {
height: number;
left: number;
top: number;
width: number;
}
Returns
undefined
| {
height
: number
;
left
: number
;
top
: number
;
width
: number
;
}
Defined in
packages/docs-ui/src/services/selection/text-range.ts:235 (opens in a new tab)
getAnchor()
getAnchor(): Nullable<Rect<IRectProps>>
Returns
Defined in
packages/docs-ui/src/services/selection/text-range.ts:282 (opens in a new tab)
isActive()
isActive(): boolean
Returns
boolean
Implementation of
Defined in
packages/docs-ui/src/services/selection/text-range.ts:298 (opens in a new tab)
isIntersection()
isIntersection(compareRange): boolean
Parameters
Parameter | Type |
---|---|
compareRange | TextRange |
Returns
boolean
Defined in
packages/docs-ui/src/services/selection/text-range.ts:322 (opens in a new tab)
refresh()
refresh(): void
Returns
void
Implementation of
Defined in
packages/docs-ui/src/services/selection/text-range.ts:334 (opens in a new tab)