@univerjs/docs-ui v0.5.4


Class: TextRange

Defined in: submodules/univer/packages/docs-ui/src/services/selection/text-range.ts:95

Implements

Constructors

new TextRange()

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

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

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

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

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

Returns

boolean

Implementation of

IDocRange.collapsed


direction

Get Signature

get direction(): RANGE_DIRECTION

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

Returns

RANGE_DIRECTION

Implementation of

IDocRange.direction


endNodePosition

Get Signature

get endNodePosition(): Nullable<INodePosition>

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

Returns

Nullable<INodePosition>

Implementation of

IDocRange.endNodePosition


endOffset

Get Signature

get endOffset(): undefined | number

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

Returns

undefined | number

Implementation of

IDocRange.endOffset


segmentId

Get Signature

get segmentId(): string

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

Returns

string

Implementation of

IDocRange.segmentId


segmentPage

Get Signature

get segmentPage(): number

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

Returns

number

Implementation of

IDocRange.segmentPage


startNodePosition

Get Signature

get startNodePosition(): 
  | null
  | INodePosition

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

Returns

| null | INodePosition

Implementation of

IDocRange.startNodePosition


startOffset

Get Signature

get startOffset(): undefined | number

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

Returns

undefined | number

Implementation of

IDocRange.startOffset

Methods

activate()

activate(): void

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

Returns

void


activeStatic()

activeStatic(): void

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

Returns

void


deactivate()

deactivate(): void

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

Returns

void


deactivateStatic()

deactivateStatic(): void

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

Returns

void


dispose()

dispose(): void

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

Returns

void

Implementation of

IDocRange.dispose


getAbsolutePosition()

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

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

Returns

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


getAnchor()

getAnchor(): Nullable<Rect>

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

Returns

Nullable<Rect>


isActive()

isActive(): boolean

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

Returns

boolean

Implementation of

IDocRange.isActive


isIntersection()

isIntersection(compareRange): boolean

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

Parameters

ParameterType
compareRangeTextRange

Returns

boolean


refresh()

refresh(): void

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

Returns

void

Implementation of

IDocRange.refresh