1/*! ***************************************************************************** 2Copyright (c) Microsoft Corporation. All rights reserved. 3Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4this file except in compliance with the License. You may obtain a copy of the 5License at http://www.apache.org/licenses/LICENSE-2.0 6 7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10MERCHANTABLITY OR NON-INFRINGEMENT. 11 12See the Apache Version 2.0 License for specific language governing permissions 13and limitations under the License. 14***************************************************************************** */ 15 16 17 18/// <reference no-default-lib="true"/> 19 20 21declare namespace Reflect { 22 /** 23 * Calls the function with the specified object as the this value 24 * and the elements of specified array as the arguments. 25 * @param target The function to call. 26 * @param thisArgument The object to be used as the this object. 27 * @param argumentsList An array of argument values to be passed to the function. 28 */ 29 function apply<T, A extends readonly any[], R>( 30 target: (this: T, ...args: A) => R, 31 thisArgument: T, 32 argumentsList: Readonly<A>, 33 ): R; 34 function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any; 35 36 /** 37 * Constructs the target with the elements of specified array as the arguments 38 * and the specified constructor as the `new.target` value. 39 * @param target The constructor to invoke. 40 * @param argumentsList An array of argument values to be passed to the constructor. 41 * @param newTarget The constructor to be used as the `new.target` object. 42 */ 43 function construct<A extends readonly any[], R>( 44 target: new (...args: A) => R, 45 argumentsList: Readonly<A>, 46 newTarget?: new (...args: any) => any, 47 ): R; 48 function construct(target: Function, argumentsList: ArrayLike<any>, newTarget?: Function): any; 49 50 /** 51 * Adds a property to an object, or modifies attributes of an existing property. 52 * @param target Object on which to add or modify the property. This can be a native JavaScript object 53 * (that is, a user-defined object or a built in object) or a DOM object. 54 * @param propertyKey The property name. 55 * @param attributes Descriptor for the property. It can be for a data property or an accessor property. 56 */ 57 function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): boolean; 58 59 /** 60 * Removes a property from an object, equivalent to `delete target[propertyKey]`, 61 * except it won't throw if `target[propertyKey]` is non-configurable. 62 * @param target Object from which to remove the own property. 63 * @param propertyKey The property name. 64 */ 65 function deleteProperty(target: object, propertyKey: PropertyKey): boolean; 66 67 /** 68 * Gets the property of target, equivalent to `target[propertyKey]` when `receiver === target`. 69 * @param target Object that contains the property on itself or in its prototype chain. 70 * @param propertyKey The property name. 71 * @param receiver The reference to use as the `this` value in the getter function, 72 * if `target[propertyKey]` is an accessor property. 73 */ 74 function get<T extends object, P extends PropertyKey>( 75 target: T, 76 propertyKey: P, 77 receiver?: unknown, 78 ): P extends keyof T ? T[P] : any; 79 80 /** 81 * Gets the own property descriptor of the specified object. 82 * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. 83 * @param target Object that contains the property. 84 * @param propertyKey The property name. 85 */ 86 function getOwnPropertyDescriptor<T extends object, P extends PropertyKey>( 87 target: T, 88 propertyKey: P, 89 ): TypedPropertyDescriptor<P extends keyof T ? T[P] : any> | undefined; 90 91 /** 92 * Returns the prototype of an object. 93 * @param target The object that references the prototype. 94 */ 95 function getPrototypeOf(target: object): object | null; 96 97 /** 98 * Equivalent to `propertyKey in target`. 99 * @param target Object that contains the property on itself or in its prototype chain. 100 * @param propertyKey Name of the property. 101 */ 102 function has(target: object, propertyKey: PropertyKey): boolean; 103 104 /** 105 * Returns a value that indicates whether new properties can be added to an object. 106 * @param target Object to test. 107 */ 108 function isExtensible(target: object): boolean; 109 110 /** 111 * Returns the string and symbol keys of the own properties of an object. The own properties of an object 112 * are those that are defined directly on that object, and are not inherited from the object's prototype. 113 * @param target Object that contains the own properties. 114 */ 115 function ownKeys(target: object): (string | symbol)[]; 116 117 /** 118 * Prevents the addition of new properties to an object. 119 * @param target Object to make non-extensible. 120 * @return Whether the object has been made non-extensible. 121 */ 122 function preventExtensions(target: object): boolean; 123 124 /** 125 * Sets the property of target, equivalent to `target[propertyKey] = value` when `receiver === target`. 126 * @param target Object that contains the property on itself or in its prototype chain. 127 * @param propertyKey Name of the property. 128 * @param receiver The reference to use as the `this` value in the setter function, 129 * if `target[propertyKey]` is an accessor property. 130 */ 131 function set<T extends object, P extends PropertyKey>( 132 target: T, 133 propertyKey: P, 134 value: P extends keyof T ? T[P] : any, 135 receiver?: any, 136 ): boolean; 137 function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean; 138 139 /** 140 * Sets the prototype of a specified object o to object proto or null. 141 * @param target The object to change its prototype. 142 * @param proto The value of the new prototype or null. 143 * @return Whether setting the prototype was successful. 144 */ 145 function setPrototypeOf(target: object, proto: object | null): boolean; 146} 147