UNPKG

@manuth/interceptor

Version:

Provides a convenient way to intercept method- property- and accessor-calls of an object.

24 lines (23 loc) 566 B
/** * Provides the functionality to set a property. * * @template T * The type of the target of the interception. * * @template TKey * The key of the intercepted member. */ export type PropertySetter<T, TKey extends keyof T> = /** * Sets the property with the specified {@linkcode key} of the {@linkcode target} to the specified {@linkcode value}. * * @param target * The target this interception belongs to. * * @param key * The key of the property to set. * * @param value * The value to set. */ (target: T, key: TKey, value: T[TKey]) => void;