summaryrefslogtreecommitdiff
path: root/cli/dts/lib.es2015.proxy.d.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2022-09-20 07:00:01 +1000
committerGitHub <noreply@github.com>2022-09-20 07:00:01 +1000
commit73e89844bab930f2a2821b059743faed8372ed14 (patch)
tree7d6e8ef6736e41fd98293d533208b5ebb404c5b6 /cli/dts/lib.es2015.proxy.d.ts
parent79aee3668db88be00673e920d4924626831aff88 (diff)
feat(cli): update to TypeScript 4.8 (#15064)
Diffstat (limited to 'cli/dts/lib.es2015.proxy.d.ts')
-rw-r--r--cli/dts/lib.es2015.proxy.d.ts93
1 files changed, 91 insertions, 2 deletions
diff --git a/cli/dts/lib.es2015.proxy.d.ts b/cli/dts/lib.es2015.proxy.d.ts
index 9e8b8757a..c24186615 100644
--- a/cli/dts/lib.es2015.proxy.d.ts
+++ b/cli/dts/lib.es2015.proxy.d.ts
@@ -19,23 +19,112 @@ and limitations under the License.
interface ProxyHandler<T extends object> {
+ /**
+ * A trap method for a function call.
+ * @param target The original callable object which is being proxied.
+ */
apply?(target: T, thisArg: any, argArray: any[]): any;
+
+ /**
+ * A trap for the `new` operator.
+ * @param target The original object which is being proxied.
+ * @param newTarget The constructor that was originally called.
+ */
construct?(target: T, argArray: any[], newTarget: Function): object;
- defineProperty?(target: T, p: string | symbol, attributes: PropertyDescriptor): boolean;
+
+ /**
+ * A trap for `Object.defineProperty()`.
+ * @param target The original object which is being proxied.
+ * @returns A `Boolean` indicating whether or not the property has been defined.
+ */
+ defineProperty?(target: T, property: string | symbol, attributes: PropertyDescriptor): boolean;
+
+ /**
+ * A trap for the `delete` operator.
+ * @param target The original object which is being proxied.
+ * @param p The name or `Symbol` of the property to delete.
+ * @returns A `Boolean` indicating whether or not the property was deleted.
+ */
deleteProperty?(target: T, p: string | symbol): boolean;
+
+ /**
+ * A trap for getting a property value.
+ * @param target The original object which is being proxied.
+ * @param p The name or `Symbol` of the property to get.
+ * @param receiver The proxy or an object that inherits from the proxy.
+ */
get?(target: T, p: string | symbol, receiver: any): any;
+
+ /**
+ * A trap for `Object.getOwnPropertyDescriptor()`.
+ * @param target The original object which is being proxied.
+ * @param p The name of the property whose description should be retrieved.
+ */
getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor | undefined;
+
+ /**
+ * A trap for the `[[GetPrototypeOf]]` internal method.
+ * @param target The original object which is being proxied.
+ */
getPrototypeOf?(target: T): object | null;
+
+ /**
+ * A trap for the `in` operator.
+ * @param target The original object which is being proxied.
+ * @param p The name or `Symbol` of the property to check for existence.
+ */
has?(target: T, p: string | symbol): boolean;
+
+ /**
+ * A trap for `Object.isExtensible()`.
+ * @param target The original object which is being proxied.
+ */
isExtensible?(target: T): boolean;
+
+ /**
+ * A trap for `Reflect.ownKeys()`.
+ * @param target The original object which is being proxied.
+ */
ownKeys?(target: T): ArrayLike<string | symbol>;
+
+ /**
+ * A trap for `Object.preventExtensions()`.
+ * @param target The original object which is being proxied.
+ */
preventExtensions?(target: T): boolean;
- set?(target: T, p: string | symbol, value: any, receiver: any): boolean;
+
+ /**
+ * A trap for setting a property value.
+ * @param target The original object which is being proxied.
+ * @param p The name or `Symbol` of the property to set.
+ * @param receiver The object to which the assignment was originally directed.
+ * @returns `A `Boolean` indicating whether or not the property was set.
+ */
+ set?(target: T, p: string | symbol, newValue: any, receiver: any): boolean;
+
+ /**
+ * A trap for `Object.setPrototypeOf()`.
+ * @param target The original object which is being proxied.
+ * @param newPrototype The object's new prototype or `null`.
+ */
setPrototypeOf?(target: T, v: object | null): boolean;
}
interface ProxyConstructor {
+ /**
+ * Creates a revocable Proxy object.
+ * @param target A target object to wrap with Proxy.
+ * @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
+ */
revocable<T extends object>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
+
+ /**
+ * 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.
+ * @param target A target object to wrap with Proxy.
+ * @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
+ */
new <T extends object>(target: T, handler: ProxyHandler<T>): T;
}
declare var Proxy: ProxyConstructor;