@univerjs/sheets v0.4.2 • Docs
Class: SheetInterceptorService
This class expose methods for sheet features to inject code to sheet underlying logic.
Extends
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | packages/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
Parameter | Type | Description |
---|---|---|
info | ICommandInfo <object > | ICommandInfo |
Returns
Promise
<boolean
>
Promise
Defined in
packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:143 (opens in a new tab)
dispose()
dispose(): void
Returns
void
Overrides
Defined in
packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:107 (opens in a new tab)
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)
fetchThroughInterceptors()
fetchThroughInterceptors<T, C>(name, effect?): (initValue, initContext) => Nullable<T>
Type Parameters
Type Parameter |
---|
T |
C |
Parameters
Parameter | Type |
---|---|
name | IInterceptor <T , C > |
effect ? | InterceptorEffectEnum |
Returns
Function
Parameters
Parameter | Type |
---|---|
initValue | Nullable <T > |
initContext | C |
Returns
Nullable
<T
>
Defined in
packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:225 (opens in a new tab)
generateMutationsByRanges()
generateMutationsByRanges(info): IUndoRedoCommandInfosByInterceptor
Parameters
Parameter | Type |
---|---|
info | IRangesInfo |
Returns
IUndoRedoCommandInfosByInterceptor
Defined in
packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:181 (opens in a new tab)
intercept()
intercept<T>(name, interceptor): IDisposable
Type Parameters
Type Parameter |
---|
T extends IInterceptor <any , any > |
Parameters
Parameter | Type |
---|---|
name | T |
interceptor | T |
Returns
Defined in
packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:192 (opens in a new tab)
interceptBeforeCommand()
interceptBeforeCommand(interceptor): IDisposable
Parameters
Parameter | Type |
---|---|
interceptor | IBeforeCommandInterceptor |
Returns
Defined in
packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:127 (opens in a new tab)
interceptCommand()
interceptCommand(interceptor): IDisposable
Parameters
Parameter | Type |
---|---|
interceptor | ICommandInterceptor |
Returns
Defined in
packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:115 (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
Parameter | Type | Description |
---|---|---|
interceptor | IRangeInterceptors | IRangeInterceptors |
Returns
IDisposable
Defined in
packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:153 (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
Parameter | Type |
---|---|
info | ICommandInfo <object > |
Returns
IUndoRedoCommandInfosByInterceptor
Defined in
packages/sheets/src/services/sheet-interceptor/sheet-interceptor.service.ts:170 (opens in a new tab)