Interface ProxyHandler<T>
apply?(target: T, thisArg: any, argArray: any[]): any;
construct?(target: T, argArray: any[], newTarget: Function): object;
defineProperty?(target: T, property: string | symbol, attributes: PropertyDescriptor): boolean;
deleteProperty?(target: T, p: string | symbol): boolean;
get?(target: T, p: string | symbol, receiver: any): any;
getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor;
getPrototypeOf?(target: T): object;
has?(target: T, p: string | symbol): boolean;
isExtensible?(target: T): boolean;
ownKeys?(target: T): ArrayLike<string | symbol>;
preventExtensions?(target: T): boolean;
set?(target: T, p: string | symbol, newValue: any, receiver: any): boolean;
setPrototypeOf?(target: T, v: object): boolean;
}
Type Parameters
Methods
Optional
apply
- apply(target, thisArg, argArray): any
Parameters
- target: T
The original callable object which is being proxied.
- thisArg: any
- argArray: any[]
Returns any
- target: T
Optional
construct
Optional
defineProperty
- define
Property (target, property, attributes): boolean A trap for
Object.defineProperty()
.Parameters
- target: T
The original object which is being proxied.
- property: string | symbol
- attributes: PropertyDescriptor
Returns boolean
A
Boolean
indicating whether or not the property has been defined.- target: T
Optional
deleteProperty
- delete
Property (target, p): boolean A trap for the
delete
operator.Parameters
- target: T
The original object which is being proxied.
- p: string | symbol
The name or
Symbol
of the property to delete.
Returns boolean
A
Boolean
indicating whether or not the property was deleted.- target: T
Optional
get
- get(target, p, receiver): any
A trap for getting a property value.
Parameters
- target: T
The original object which is being proxied.
- p: string | symbol
The name or
Symbol
of the property to get. - receiver: any
The proxy or an object that inherits from the proxy.
Returns any
- target: T
Optional
getOwnPropertyDescriptor
- get
Own (target, p): PropertyDescriptorProperty Descriptor A trap for
Object.getOwnPropertyDescriptor()
.Parameters
- target: T
The original object which is being proxied.
- p: string | symbol
The name of the property whose description should be retrieved.
Returns PropertyDescriptor
- target: T
Optional
getPrototypeOf
- get
Prototype (target): objectOf A trap for the
[[GetPrototypeOf]]
internal method.Parameters
- target: T
The original object which is being proxied.
Returns object
- target: T
Optional
has
- has(target, p): boolean
A trap for the
in
operator.Parameters
- target: T
The original object which is being proxied.
- p: string | symbol
The name or
Symbol
of the property to check for existence.
Returns boolean
- target: T
Optional
isExtensible
- is
Extensible (target): boolean A trap for
Object.isExtensible()
.Parameters
- target: T
The original object which is being proxied.
Returns boolean
- target: T
Optional
ownKeys
Optional
preventExtensions
- prevent
Extensions (target): boolean A trap for
Object.preventExtensions()
.Parameters
- target: T
The original object which is being proxied.
Returns boolean
- target: T
Optional
set
- set(target, p, newValue, receiver): boolean
A trap for setting a property value.
Parameters
- target: T
The original object which is being proxied.
- p: string | symbol
The name or
Symbol
of the property to set. - newValue: any
- receiver: any
The object to which the assignment was originally directed.
Returns boolean
A
Boolean
indicating whether or not the property was set.- target: T
Optional
setPrototypeOf
- set
Prototype (target, v): booleanOf A trap for
Object.setPrototypeOf()
.Parameters
- target: T
The original object which is being proxied.
- v: object
Returns boolean
- target: T
A trap method for a function call.