@univerjs/docs-ui v0.5.0-beta.1 • Docs


Class: TextRange

Implements

Constructors

new TextRange()

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

Parameters

ParameterTypeDefault value
_sceneSceneundefined
_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

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:108

Properties

PropertyModifierTypeDefault valueDefined in
anchorNodePosition?publicNullable<INodePosition>undefinedsubmodules/univer/packages/docs-ui/src/services/selection/text-range.ts:112
focusNodePosition?publicNullable<INodePosition>undefinedsubmodules/univer/packages/docs-ui/src/services/selection/text-range.ts:113
rangeTypepublicDOC_RANGE_TYPEDOC_RANGE_TYPE.TEXTsubmodules/univer/packages/docs-ui/src/services/selection/text-range.ts:96
stylepublicITextSelectionStyleNORMAL_TEXT_SELECTION_PLUGIN_STYLEsubmodules/univer/packages/docs-ui/src/services/selection/text-range.ts:114

Accessors

collapsed

Get Signature

get collapsed(): boolean
Returns

boolean

Implementation of

IDocRange.collapsed

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:181


direction

Get Signature

get direction(): RANGE_DIRECTION
Returns

RANGE_DIRECTION

Implementation of

IDocRange.direction

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:215


endNodePosition

Get Signature

get endNodePosition(): Nullable<INodePosition>
Returns

Nullable<INodePosition>

Implementation of

IDocRange.endNodePosition

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:201


endOffset

Get Signature

get endOffset(): undefined | number
Returns

undefined | number

Implementation of

IDocRange.endOffset

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:164


segmentId

Get Signature

get segmentId(): string
Returns

string

Implementation of

IDocRange.segmentId

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:227


segmentPage

Get Signature

get segmentPage(): number
Returns

number

Implementation of

IDocRange.segmentPage

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:231


startNodePosition

Get Signature

get startNodePosition(): null | INodePosition
Returns

null | INodePosition

Implementation of

IDocRange.startNodePosition

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:187


startOffset

Get Signature

get startOffset(): undefined | number
Returns

undefined | number

Implementation of

IDocRange.startOffset

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:146

Methods

activate()

activate(): void

Returns

void

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:302


activeStatic()

activeStatic(): void

Returns

void

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:286


deactivate()

deactivate(): void

Returns

void

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:306


deactivateStatic()

deactivateStatic(): void

Returns

void

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:292


dispose()

dispose(): void

Returns

void

Implementation of

IDocRange.dispose

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:310


getAbsolutePosition()

getAbsolutePosition(): undefined | {
  height: number;
  left: number;
  top: number;
  width: number;
}

Returns

undefined | { height: number; left: number; top: number; width: number; }

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:235


getAnchor()

getAnchor(): Nullable<Rect<IRectProps>>

Returns

Nullable<Rect<IRectProps>>

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:282


isActive()

isActive(): boolean

Returns

boolean

Implementation of

IDocRange.isActive

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:298


isIntersection()

isIntersection(compareRange): boolean

Parameters

ParameterType
compareRangeTextRange

Returns

boolean

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:322


refresh()

refresh(): void

Returns

void

Implementation of

IDocRange.refresh

Defined in

submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:334