@univerjs/docs-ui v0.5.4


Class: Editor

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:109

Extends

Implements

  • IEditor

Constructors

new Editor()

new Editor(
   _param, 
   _univerInstanceService, 
   _docSelectionManagerService, 
   _commandService, 
   _undoRedoService): Editor

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:134

Parameters

ParameterType
_paramIEditorOptions
_univerInstanceServiceIUniverInstanceService
_docSelectionManagerServiceDocSelectionManagerService
_commandServiceICommandService
_undoRedoServiceIUndoRedoService

Returns

Editor

Overrides

Disposable.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:96
blur$publicObservable<IEditorInputConfig>undefined-submodules/univer/packages/docs-ui/src/services/editor/editor.ts:128
change$publicObservable<IEditorEvent>undefined-submodules/univer/packages/docs-ui/src/services/editor/editor.ts:112
focus$publicObservable<IEditorInputConfig>undefined-submodules/univer/packages/docs-ui/src/services/editor/editor.ts:124
input$publicObservable<IEditorInputEvent>undefined-submodules/univer/packages/docs-ui/src/services/editor/editor.ts:116
paste$publicObservable<IEditorInputConfig>undefined-submodules/univer/packages/docs-ui/src/services/editor/editor.ts:120
selectionChange$publicObservable<IDocSelectionInnerParam>undefined-submodules/univer/packages/docs-ui/src/services/editor/editor.ts:132

Accessors

cancelDefaultResizeListener

Get Signature

get cancelDefaultResizeListener(): undefined | boolean

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:388

Returns

undefined | boolean


docSelectionRenderService

Get Signature

get docSelectionRenderService(): DocSelectionRenderService

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:146

Returns

DocSelectionRenderService


editorDOM

Get Signature

get editorDOM(): HTMLDivElement

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:404

Returns

HTMLDivElement


editorUnitId

Get Signature

get editorUnitId(): undefined | string

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:377

Deprecated

use getEditorId.

Returns

undefined | string


params

Get Signature

get params(): IEditorOptions

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:384

Deprecated

@TODO:

JOCS

remove this in the future.

Returns

IEditorOptions


render

Get Signature

get render(): IRender

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:392

Returns

IRender

Methods

blur()

blur(): void

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:262

Returns

void

Deprecated

use IEditorService.blur as instead. this is for internal usage.

Implementation of

IEditor.blur

clearUndoRedoHistory()

clearUndoRedoHistory(): void

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:362

Returns

void

Implementation of

IEditor.clearUndoRedoHistory

dispose()

dispose(): void

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:368

Returns

void

Overrides

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


focus()

focus(): void

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:233

Returns

void

Deprecated

use IEditorService.focus as instead. this is for internal usage.

Implementation of

IEditor.focus

getBody()

getBody(): 
  | undefined
  | IDocumentBody

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:428

Returns

| undefined | IDocumentBody

Deprecated

use getDocumentData.


getBoundingClientRect()

getBoundingClientRect(): DOMRect

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:400

Returns

DOMRect


getCursorPosition()

getCursorPosition(): number

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:301

Returns

number


getDocumentData()

getDocumentData(): IDocumentData

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:313

Returns

IDocumentData

Implementation of

IEditor.getDocumentData

getDocumentDataModel()

getDocumentDataModel(): DocumentDataModel

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:319

Returns

DocumentDataModel


getEditorId()

getEditorId(): string

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:308

Returns

string

Implementation of

IEditor.getEditorId

getSelectionRanges()

getSelectionRanges(): ITextRangeWithStyle[]

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:291

Returns

ITextRangeWithStyle[]

Implementation of

IEditor.getSelectionRanges

getValue()

getValue(): string

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:419

Returns

string

Deprecated

use getDocumentData.


isFocus()

isFocus(): boolean

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:225

Returns

boolean

Implementation of

IEditor.isFocus

isReadOnly()

isReadOnly(): boolean

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:396

Returns

boolean


isSheetEditor()

isSheetEditor(): boolean

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:412

Returns

boolean


isVisible()

isVisible(): undefined | boolean

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:408

Returns

undefined | boolean


replaceText()

replaceText(text, resetCursor): void

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:334

Parameters

ParameterTypeDefault value
textstringundefined
resetCursorbooleantrue

Returns

void


select()

select(): void

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:270

Returns

void

Implementation of

IEditor.select

setDocumentData()

setDocumentData(data, textRanges): void

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:324

Parameters

ParameterType
dataIDocumentData
textRangesNullable<ITextRangeWithStyle[]>

Returns

void

Implementation of

IEditor.setDocumentData

setSelectionRanges()

setSelectionRanges(ranges): void

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:280

Parameters

ParameterType
rangesISuccinctDocRangeParam[]

Returns

void

Implementation of

IEditor.setSelectionRanges

update()

update(param): void

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:436

@deprecated.

Parameters

ParameterType
paramPartial<IEditorOptions>

Returns

void


updateCanvasStyle()

updateCanvasStyle(): void

Defined in: submodules/univer/packages/docs-ui/src/services/editor/editor.ts:446

@deprecated.

Returns

void