API Reference
@univerjs
@univerjs/docs-ui
classes
Textrange

@univerjs/docs-ui v0.4.2Docs


Class: TextRange

Implements

Constructors

new TextRange()

new TextRange(
   _scene, 
   _document, 
   _docSkeleton, 
   anchorNodePosition?, 
   focusNodePosition?, 
   style?, 
   _segmentId?, 
   _segmentPage?): TextRange

Parameters

ParameterTypeDefault value
_sceneThinSceneundefined
_documentDocumentsundefined
_docSkeletonDocumentSkeletonundefined
anchorNodePosition?Nullable<INodePosition>undefined
focusNodePosition?Nullable<INodePosition>undefined
style?ITextSelectionStyleNORMAL_TEXT_SELECTION_PLUGIN_STYLE
_segmentId?string''
_segmentPage?number-1

Returns

TextRange

Defined in

packages/docs-ui/src/services/selection/text-range.ts:108 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueDefined in
anchorNodePosition?publicNullable<INodePosition>undefinedpackages/docs-ui/src/services/selection/text-range.ts:112 (opens in a new tab)
focusNodePosition?publicNullable<INodePosition>undefinedpackages/docs-ui/src/services/selection/text-range.ts:113 (opens in a new tab)
rangeTypepublicDOC_RANGE_TYPEDOC_RANGE_TYPE.TEXTpackages/docs-ui/src/services/selection/text-range.ts:96 (opens in a new tab)
stylepublicITextSelectionStyleNORMAL_TEXT_SELECTION_PLUGIN_STYLEpackages/docs-ui/src/services/selection/text-range.ts:114 (opens in a new tab)

Accessors

collapsed

get collapsed(): boolean

Returns

boolean

Implementation of

IDocRange.collapsed

Defined in

packages/docs-ui/src/services/selection/text-range.ts:181 (opens in a new tab)


direction

get direction(): RANGE_DIRECTION

Returns

RANGE_DIRECTION

Implementation of

IDocRange.direction

Defined in

packages/docs-ui/src/services/selection/text-range.ts:215 (opens in a new tab)


endNodePosition

get endNodePosition(): Nullable<INodePosition>

Returns

Nullable<INodePosition>

Implementation of

IDocRange.endNodePosition

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

IDocRange.endOffset

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

IDocRange.segmentId

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

IDocRange.segmentPage

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

IDocRange.startNodePosition

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

IDocRange.startOffset

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

IDocRange.dispose

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

Nullable<Rect<IRectProps>>

Defined in

packages/docs-ui/src/services/selection/text-range.ts:282 (opens in a new tab)


isActive()

isActive(): boolean

Returns

boolean

Implementation of

IDocRange.isActive

Defined in

packages/docs-ui/src/services/selection/text-range.ts:298 (opens in a new tab)


isIntersection()

isIntersection(compareRange): boolean

Parameters

ParameterType
compareRangeTextRange

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

IDocRange.refresh

Defined in

packages/docs-ui/src/services/selection/text-range.ts:334 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.