|
1 | 1 | /// <reference no-default-lib="true"/>
|
2 | 2 |
|
3 | 3 | declare namespace Reflect {
|
| 4 | + /** |
| 5 | + * Calls the function with the specified object as the this value |
| 6 | + * and the elements of specified array as the arguments. |
| 7 | + * @param target The function to call. |
| 8 | + * @param thisArgument The object to be used as the this object. |
| 9 | + * @param argumentsList An array of argument values to be passed to the function. |
| 10 | + */ |
4 | 11 | function apply(
|
5 | 12 | target: Function,
|
6 | 13 | thisArgument: any,
|
7 | 14 | argumentsList: ArrayLike<any>
|
8 | 15 | ): unknown;
|
| 16 | + |
| 17 | + /** |
| 18 | + * Constructs the target with the elements of specified array as the arguments |
| 19 | + * and the specified constructor as the `new.target` value. |
| 20 | + * @param target The constructor to invoke. |
| 21 | + * @param argumentsList An array of argument values to be passed to the constructor. |
| 22 | + * @param newTarget The constructor to be used as the `new.target` object. |
| 23 | + */ |
9 | 24 | function construct(
|
10 | 25 | target: Function,
|
11 | 26 | argumentsList: ArrayLike<any>,
|
12 | 27 | newTarget?: any
|
13 | 28 | ): object;
|
| 29 | + |
| 30 | + /** |
| 31 | + * Adds a property to an object, or modifies attributes of an existing property. |
| 32 | + * @param target Object on which to add or modify the property. This can be a native JavaScript object |
| 33 | + * (that is, a user-defined object or a built in object) or a DOM object. |
| 34 | + * @param propertyKey The property name. |
| 35 | + * @param attributes Descriptor for the property. It can be for a data property or an accessor property. |
| 36 | + */ |
14 | 37 | function defineProperty(
|
15 | 38 | target: object,
|
16 | 39 | propertyKey: PropertyKey,
|
17 | 40 | attributes: PropertyDescriptor
|
18 | 41 | ): boolean;
|
| 42 | + |
| 43 | + /** |
| 44 | + * Removes a property from an object, equivalent to `delete target[propertyKey]`, |
| 45 | + * except it won't throw if `target[propertyKey]` is non-configurable. |
| 46 | + * @param target Object from which to remove the own property. |
| 47 | + * @param propertyKey The property name. |
| 48 | + */ |
19 | 49 | function deleteProperty(target: object, propertyKey: PropertyKey): boolean;
|
| 50 | + |
| 51 | + /** |
| 52 | + * Gets the property of target, equivalent to `target[propertyKey]` when `receiver === target`. |
| 53 | + * @param target Object that contains the property on itself or in its prototype chain. |
| 54 | + * @param propertyKey The property name. |
| 55 | + * @param receiver The reference to use as the `this` value in the getter function, |
| 56 | + * if `target[propertyKey]` is an accessor property. |
| 57 | + */ |
20 | 58 | function get<T, K extends PropertyKey>(
|
21 | 59 | target: T,
|
22 | 60 | propertyKey: K,
|
23 | 61 | receiver?: any
|
24 | 62 | ): K extends keyof T ? T[K] : unknown;
|
| 63 | + |
| 64 | + /** |
| 65 | + * Gets the own property descriptor of the specified object. |
| 66 | + * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. |
| 67 | + * @param target Object that contains the property. |
| 68 | + * @param propertyKey The property name. |
| 69 | + */ |
25 | 70 | function getOwnPropertyDescriptor(
|
26 | 71 | target: object,
|
27 | 72 | propertyKey: PropertyKey
|
28 | 73 | ): PropertyDescriptor | undefined;
|
| 74 | + |
| 75 | + /** |
| 76 | + * Returns the prototype of an object. |
| 77 | + * @param target The object that references the prototype. |
| 78 | + */ |
29 | 79 | function getPrototypeOf(target: object): object;
|
| 80 | + |
| 81 | + /** |
| 82 | + * Equivalent to `propertyKey in target`. |
| 83 | + * @param target Object that contains the property on itself or in its prototype chain. |
| 84 | + * @param propertyKey Name of the property. |
| 85 | + */ |
30 | 86 | function has(target: object, propertyKey: PropertyKey): boolean;
|
| 87 | + |
| 88 | + /** |
| 89 | + * Returns a value that indicates whether new properties can be added to an object. |
| 90 | + * @param target Object to test. |
| 91 | + */ |
31 | 92 | function isExtensible(target: object): boolean;
|
| 93 | + |
| 94 | + /** |
| 95 | + * Returns the string and symbol keys of the own properties of an object. The own properties of an object |
| 96 | + * are those that are defined directly on that object, and are not inherited from the object's prototype. |
| 97 | + * @param target Object that contains the own properties. |
| 98 | + */ |
32 | 99 | function ownKeys(target: object): PropertyKey[];
|
| 100 | + |
| 101 | + /** |
| 102 | + * Prevents the addition of new properties to an object. |
| 103 | + * @param target Object to make non-extensible. |
| 104 | + * @return Whether the object has been made non-extensible. |
| 105 | + */ |
33 | 106 | function preventExtensions(target: object): boolean;
|
| 107 | + |
| 108 | + /** |
| 109 | + * Sets the property of target, equivalent to `target[propertyKey] = value` when `receiver === target`. |
| 110 | + * @param target Object that contains the property on itself or in its prototype chain. |
| 111 | + * @param propertyKey Name of the property. |
| 112 | + * @param receiver The reference to use as the `this` value in the setter function, |
| 113 | + * if `target[propertyKey]` is an accessor property. |
| 114 | + */ |
34 | 115 | function set(
|
35 | 116 | target: object,
|
36 | 117 | propertyKey: PropertyKey,
|
37 | 118 | value: any,
|
38 | 119 | receiver?: any
|
39 | 120 | ): boolean;
|
| 121 | + |
| 122 | + /** |
| 123 | + * Sets the prototype of a specified object o to object proto or null. |
| 124 | + * @param target The object to change its prototype. |
| 125 | + * @param proto The value of the new prototype or null. |
| 126 | + * @return Whether setting the prototype was successful. |
| 127 | + */ |
40 | 128 | function setPrototypeOf(target: object, proto: any): boolean;
|
41 | 129 | }
|
0 commit comments