Skip to content

Commit a514b54

Browse files
Restore documentations of lib.es2015.reflect.d.ts
1 parent e6cc267 commit a514b54

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

lib/lib.es2015.reflect.d.ts

+88
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,129 @@
11
/// <reference no-default-lib="true"/>
22

33
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+
*/
411
function apply(
512
target: Function,
613
thisArgument: any,
714
argumentsList: ArrayLike<any>
815
): 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+
*/
924
function construct(
1025
target: Function,
1126
argumentsList: ArrayLike<any>,
1227
newTarget?: any
1328
): 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+
*/
1437
function defineProperty(
1538
target: object,
1639
propertyKey: PropertyKey,
1740
attributes: PropertyDescriptor
1841
): 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+
*/
1949
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+
*/
2058
function get<T, K extends PropertyKey>(
2159
target: T,
2260
propertyKey: K,
2361
receiver?: any
2462
): 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+
*/
2570
function getOwnPropertyDescriptor(
2671
target: object,
2772
propertyKey: PropertyKey
2873
): PropertyDescriptor | undefined;
74+
75+
/**
76+
* Returns the prototype of an object.
77+
* @param target The object that references the prototype.
78+
*/
2979
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+
*/
3086
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+
*/
3192
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+
*/
3299
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+
*/
33106
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+
*/
34115
function set(
35116
target: object,
36117
propertyKey: PropertyKey,
37118
value: any,
38119
receiver?: any
39120
): 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+
*/
40128
function setPrototypeOf(target: object, proto: any): boolean;
41129
}

0 commit comments

Comments
 (0)