Interface ProxyConstructor
interface ProxyConstructor {
new ProxyConstructornew <T>(target: T, handler: ProxyHandler<T>): T;
revocable<T>(target: T, handler: ProxyHandler<T>): {
proxy: T;
revoke: (() => void);
};
}
new ProxyConstructornew <T>(target: T, handler: ProxyHandler<T>): T;
revocable<T>(target: T, handler: ProxyHandler<T>): {
proxy: T;
revoke: (() => void);
};
}
Index
Constructors
Methods
Methods
revocable
- revocable<T>(target, handler): {
proxy: T;
revoke: (() => void);
} Creates a revocable Proxy object.
Type Parameters
Parameters
- target: T
A target object to wrap with Proxy.
- handler: ProxyHandler<T>
An object whose properties define the behavior of Proxy when an operation is attempted on it.
Returns {
proxy: T;
revoke: (() => void);
}proxy: T
revoke: (() => void)
- (): void
Returns void
- target: T
Creates a Proxy object. The Proxy object allows you to create an object that can be used in place of the original object, but which may redefine fundamental Object operations like getting, setting, and defining properties. Proxy objects are commonly used to log property accesses, validate, format, or sanitize inputs.