API Reference
@univerjs
@univerjs/sheets
classes
Sheetinterceptorservice

@univerjs/sheets v0.2.14Docs


Class: SheetInterceptorService

This class expose methods for sheet features to inject code to sheet underlying logic.

Extends

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedpackages/core/src/shared/lifecycle.ts:93 (opens in a new tab)

Methods

beforeCommandExecute()

beforeCommandExecute(info): Promise<boolean>

before command execute, call this method to get the flag of whether it can be executed the command,

Parameters

ParameterTypeDescription
infoICommandInfo<object>ICommandInfo

Returns

Promise<boolean>

Promise

Defined in

packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:138 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:102 (opens in a new tab)


disposeWithMe()

protected 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)


fetchThroughInterceptors()

fetchThroughInterceptors<T, C>(name): (initValue, initContext) => Nullable<T>

Type Parameters

Type Parameter
T
C

Parameters

ParameterType
nameIInterceptor<T, C>

Returns

Function

Parameters
ParameterType
initValueNullable<T>
initContextC
Returns

Nullable<T>

Defined in

packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:203 (opens in a new tab)


generateMutationsByRanges()

generateMutationsByRanges(info): IUndoRedoCommandInfosByInterceptor

Parameters

ParameterType
infoIRangesInfo

Returns

IUndoRedoCommandInfosByInterceptor

Defined in

packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:176 (opens in a new tab)


intercept()

intercept<T>(name, interceptor): IDisposable

Type Parameters

Type Parameter
T extends IInterceptor<any, any>

Parameters

ParameterType
nameT
interceptorT

Returns

IDisposable

Defined in

packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:187 (opens in a new tab)


interceptBeforeCommand()

interceptBeforeCommand(interceptor): IDisposable

Parameters

ParameterType
interceptorIBeforeCommandInterceptor

Returns

IDisposable

Defined in

packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:122 (opens in a new tab)


interceptCommand()

interceptCommand(interceptor): IDisposable

Parameters

ParameterType
interceptorICommandInterceptor

Returns

IDisposable

Defined in

packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:110 (opens in a new tab)


interceptRanges()

interceptRanges(interceptor): IDisposable

By adding callbacks to some Ranges can get some additional mutations, such as clearing all plugin data in a certain area.

Parameters

ParameterTypeDescription
interceptorIRangeInterceptorsIRangeInterceptors

Returns

IDisposable

IDisposable

Defined in

packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:148 (opens in a new tab)


onCommandExecute()

onCommandExecute(info): IUndoRedoCommandInfosByInterceptor

When command is executing, call this method to gether undo redo mutations from upper features.

Parameters

ParameterType
infoICommandInfo<object>

Returns

IUndoRedoCommandInfosByInterceptor

Defined in

packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:165 (opens in a new tab)


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