Skip to content

@istock/editor / Exports / CommandEditorCursor

Class: CommandEditorCursor

编辑框光标操作

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new CommandEditorCursor(commandInput): CommandEditorCursor

Parameters

NameType
commandInputHTMLElement

Returns

CommandEditorCursor

Defined in

command-editor-cursor.ts:9

Properties

#commandInput

Private Readonly #commandInput: HTMLElement

Defined in

command-editor-cursor.ts:7


selection

selection: Selection

Defined in

command-editor-cursor.ts:5

Methods

getOneRange

getOneRange(): Range

获取Range对象

Returns

Range

Defined in

command-editor-cursor.ts:19


moveNodeOffset

moveNodeOffset(endNode, endOffset): void

移动到指定节点及对应偏移位置

Parameters

NameType
endNodeNode | Element
endOffsetnumber

Returns

void

Defined in

command-editor-cursor.ts:149


moveToEnd

moveToEnd(): void

移动光标到开始位置

Returns

void

Defined in

command-editor-cursor.ts:104


moveToStart

moveToStart(): void

移动光标到开始位置

Returns

void

Defined in

command-editor-cursor.ts:91


moveTokenOffset

moveTokenOffset(number?, isBefore?): void

光标向前或后移动指定个token位置

Parameters

NameTypeDefault value
numbernumber1
isBeforebooleantrue

Returns

void

Defined in

command-editor-cursor.ts:119


setOffset

setOffset(offset): void

设置光标位置

Parameters

NameType
offsetnumber

Returns

void

Defined in

command-editor-cursor.ts:39

免责声明:本站所有信息、数据、软件仅供学习研究,都不构成投资建议,本站不承担由此导致的任何责任。