@univerjscoreclassesInterceptormanager

@univerjs/core v0.5.4


Class: InterceptorManager<P>

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/common/interceptor.ts:93

Type Parameters

Type Parameter
P extends Record<string, IInterceptor<any, any>>

Constructors

new InterceptorManager()

new InterceptorManager<P>(interceptorPoints): InterceptorManager<P>

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/common/interceptor.ts:97

Parameters

ParameterType
interceptorPointsP

Returns

InterceptorManager<P>

Methods

dispose()

dispose(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/common/interceptor.ts:138

Returns

void


fetchThroughInterceptors()

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

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/common/interceptor.ts:108

Get the interceptors.

Type Parameters

Type Parameter
T
C

Parameters

ParameterTypeDescription
nameIInterceptor<T, C>Name of the intercepted point.
filter?(interceptor) => booleanA callback function to filter the interceptors.

Returns

Function

It will return a composed interceptor function. If you will perform the interceptor repeatedly, you should cache the result instead of calling this function multiple times.

Parameters
ParameterType
initValueNullable<T>
initContextC
Returns

Nullable<T>


getInterceptPoints()

getInterceptPoints(): P

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/common/interceptor.ts:134

Returns

P


intercept()

intercept<T>(name, interceptor): () => boolean

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/common/interceptor.ts:119

Type Parameters

Type Parameter
T extends IInterceptor<any, any>

Parameters

ParameterType
nameT
interceptorT

Returns

Function

Returns

boolean