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

@univerjs/docs-ui v0.4.2Docs


Class: Editor

Extends

Implements

  • IEditor

Constructors

new Editor()

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

Parameters

ParameterType
_paramIEditorOptions
_univerInstanceServiceIUniverInstanceService
_docSelectionManagerServiceDocSelectionManagerService
_commandServiceICommandService
_undoRedoServiceIUndoRedoService

Returns

Editor

Overrides

Disposable.constructor

Defined in

packages/docs-ui/src/services/editor/editor.ts:182 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedpackages/core/src/shared/lifecycle.ts:93 (opens in a new tab)
blur$publicObservable<IEditorInputConfig>undefined-packages/docs-ui/src/services/editor/editor.ts:170 (opens in a new tab)
change$publicObservable<IEditorEvent>undefined-packages/docs-ui/src/services/editor/editor.ts:153 (opens in a new tab)
focus$publicObservable<IEditorInputConfig>undefined-packages/docs-ui/src/services/editor/editor.ts:166 (opens in a new tab)
input$publicObservable<IEditorInputEvent>undefined-packages/docs-ui/src/services/editor/editor.ts:157 (opens in a new tab)
paste$publicObservable<IEditorInputConfig>undefined-packages/docs-ui/src/services/editor/editor.ts:161 (opens in a new tab)
selectionChange$publicObservable<IDocSelectionInnerParam>undefined-packages/docs-ui/src/services/editor/editor.ts:174 (opens in a new tab)

Accessors

cancelDefaultResizeListener

get cancelDefaultResizeListener(): undefined | boolean

Returns

undefined | boolean

Defined in

packages/docs-ui/src/services/editor/editor.ts:389 (opens in a new tab)


editorUnitId

get editorUnitId(): undefined | string

Deprecated

use getEditorId.

Returns

undefined | string

Defined in

packages/docs-ui/src/services/editor/editor.ts:378 (opens in a new tab)


params

get params(): IEditorOptions

Deprecated

@TODO:

JOCS

remove this in the future.

Returns

IEditorOptions

Defined in

packages/docs-ui/src/services/editor/editor.ts:385 (opens in a new tab)


render

get render(): IRender

Returns

IRender

Defined in

packages/docs-ui/src/services/editor/editor.ts:393 (opens in a new tab)

Methods

blur()

blur(): void

Returns

void

Implementation of

IEditor.blur

Defined in

packages/docs-ui/src/services/editor/editor.ts:299 (opens in a new tab)


clearUndoRedoHistory()

clearUndoRedoHistory(): void

Returns

void

Implementation of

IEditor.clearUndoRedoHistory

Defined in

packages/docs-ui/src/services/editor/editor.ts:363 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

packages/docs-ui/src/services/editor/editor.ts:369 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)


focus()

focus(): void

Returns

void

Implementation of

IEditor.focus

Defined in

packages/docs-ui/src/services/editor/editor.ts:271 (opens in a new tab)


getBody()

getBody(): undefined | IDocumentBody

Returns

undefined | IDocumentBody

Deprecated

use getDocumentData.

Defined in

packages/docs-ui/src/services/editor/editor.ts:494 (opens in a new tab)


getBoundingClientRect()

getBoundingClientRect(): DOMRect

Returns

DOMRect

Defined in

packages/docs-ui/src/services/editor/editor.ts:464 (opens in a new tab)


getDocumentData()

getDocumentData(): IDocumentData

Returns

IDocumentData

Implementation of

IEditor.getDocumentData

Defined in

packages/docs-ui/src/services/editor/editor.ts:345 (opens in a new tab)


getEditorId()

getEditorId(): string

Returns

string

Implementation of

IEditor.getEditorId

Defined in

packages/docs-ui/src/services/editor/editor.ts:340 (opens in a new tab)


getOpenForSheetSubUnitId()

getOpenForSheetSubUnitId(): Nullable<string>

Returns

Nullable<string>

Deprecated

Defined in

packages/docs-ui/src/services/editor/editor.ts:417 (opens in a new tab)


getOpenForSheetUnitId()

getOpenForSheetUnitId(): Nullable<string>

Returns

Nullable<string>

Deprecated

Defined in

packages/docs-ui/src/services/editor/editor.ts:407 (opens in a new tab)


getSelectionRanges()

getSelectionRanges(): ITextRangeWithStyle[]

Returns

ITextRangeWithStyle[]

Implementation of

IEditor.getSelectionRanges

Defined in

packages/docs-ui/src/services/editor/editor.ts:329 (opens in a new tab)


getValue()

getValue(): string

Returns

string

Deprecated

use getDocumentData.

Defined in

packages/docs-ui/src/services/editor/editor.ts:485 (opens in a new tab)


isFocus()

isFocus(): boolean

Returns

boolean

Implementation of

IEditor.isFocus

Defined in

packages/docs-ui/src/services/editor/editor.ts:431 (opens in a new tab)


isFormulaEditor()

isFormulaEditor(): boolean

Returns

boolean

Deprecated

Defined in

packages/docs-ui/src/services/editor/editor.ts:478 (opens in a new tab)


isReadOnly()

isReadOnly(): boolean

Returns

boolean

Defined in

packages/docs-ui/src/services/editor/editor.ts:445 (opens in a new tab)


isSheetEditor()

isSheetEditor(): boolean

Returns

boolean

Deprecated

Defined in

packages/docs-ui/src/services/editor/editor.ts:473 (opens in a new tab)


isSingle()

isSingle(): boolean

Returns

boolean

Deprecated

Defined in

packages/docs-ui/src/services/editor/editor.ts:441 (opens in a new tab)


isSingleChoice()

isSingleChoice(): boolean

Returns

boolean

Defined in

packages/docs-ui/src/services/editor/editor.ts:397 (opens in a new tab)


isValueLegality()

isValueLegality(): boolean

Returns

boolean

Deprecated

Defined in

packages/docs-ui/src/services/editor/editor.ts:422 (opens in a new tab)


isVisible()

isVisible(): undefined | boolean

Returns

undefined | boolean

Defined in

packages/docs-ui/src/services/editor/editor.ts:468 (opens in a new tab)


onlyInputContent()

onlyInputContent(): boolean

Returns

boolean

Deprecated

Defined in

packages/docs-ui/src/services/editor/editor.ts:450 (opens in a new tab)


onlyInputFormula()

onlyInputFormula(): boolean

Returns

boolean

Deprecated

Defined in

packages/docs-ui/src/services/editor/editor.ts:455 (opens in a new tab)


onlyInputRange()

onlyInputRange(): boolean

Returns

boolean

Deprecated

Defined in

packages/docs-ui/src/services/editor/editor.ts:460 (opens in a new tab)


select()

select(): void

Returns

void

Implementation of

IEditor.select

Defined in

packages/docs-ui/src/services/editor/editor.ts:308 (opens in a new tab)


setDocumentData()

setDocumentData(data, textRanges): void

Parameters

ParameterType
dataIDocumentData
textRangesNullable<ITextRangeWithStyle[]>

Returns

void

Implementation of

IEditor.setDocumentData

Defined in

packages/docs-ui/src/services/editor/editor.ts:352 (opens in a new tab)


setFocus()

setFocus(state): void

Parameters

ParameterTypeDefault value
statebooleanfalse

Returns

void

Deprecated

Defined in

packages/docs-ui/src/services/editor/editor.ts:436 (opens in a new tab)


setOpenForSheetSubUnitId()

setOpenForSheetSubUnitId(subUnitId): void

Parameters

ParameterType
subUnitIdNullable<string>

Returns

void

Deprecated

Defined in

packages/docs-ui/src/services/editor/editor.ts:412 (opens in a new tab)


setOpenForSheetUnitId()

setOpenForSheetUnitId(unitId): void

Parameters

ParameterType
unitIdNullable<string>

Returns

void

Deprecated

Defined in

packages/docs-ui/src/services/editor/editor.ts:402 (opens in a new tab)


setSelectionRanges()

setSelectionRanges(ranges): void

Parameters

ParameterType
rangesISuccinctDocRangeParam[]

Returns

void

Implementation of

IEditor.setSelectionRanges

Defined in

packages/docs-ui/src/services/editor/editor.ts:318 (opens in a new tab)


setValueLegality()

setValueLegality(state): void

Parameters

ParameterTypeDefault value
statebooleantrue

Returns

void

Deprecated

Defined in

packages/docs-ui/src/services/editor/editor.ts:427 (opens in a new tab)


update()

update(param): void

@deprecated.

Parameters

ParameterType
paramPartial<IEditorOptions>

Returns

void

Defined in

packages/docs-ui/src/services/editor/editor.ts:502 (opens in a new tab)


updateCanvasStyle()

updateCanvasStyle(): void

@deprecated.

Returns

void

Defined in

packages/docs-ui/src/services/editor/editor.ts:548 (opens in a new tab)


verticalAlign()

verticalAlign(): void

@deprecated.

Returns

void

Defined in

packages/docs-ui/src/services/editor/editor.ts:512 (opens in a new tab)


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