@@ -6,6 +6,11 @@ declare namespace Reflect {
6
6
* @param thisArgument The object to be used as the this object.
7
7
* @param argumentsList An array of argument values to be passed to the function.
8
8
*/
9
+ function apply < T , A extends readonly any [ ] , R > (
10
+ target : ( this : T , ...args : A ) => R ,
11
+ thisArgument : T ,
12
+ argumentsList : Readonly < A > ,
13
+ ) : R ;
9
14
function apply ( target : Function , thisArgument : any , argumentsList : ArrayLike < any > ) : any ;
10
15
11
16
/**
@@ -15,6 +20,11 @@ declare namespace Reflect {
15
20
* @param argumentsList An array of argument values to be passed to the constructor.
16
21
* @param newTarget The constructor to be used as the `new.target` object.
17
22
*/
23
+ function construct < A extends readonly any [ ] , R > (
24
+ target : new ( ...args : A ) => R ,
25
+ argumentsList : Readonly < A > ,
26
+ newTarget ?: new ( ...args : any ) => any ,
27
+ ) : R ;
18
28
function construct ( target : Function , argumentsList : ArrayLike < any > , newTarget ?: Function ) : any ;
19
29
20
30
/**
@@ -41,15 +51,22 @@ declare namespace Reflect {
41
51
* @param receiver The reference to use as the `this` value in the getter function,
42
52
* if `target[propertyKey]` is an accessor property.
43
53
*/
44
- function get ( target : object , propertyKey : PropertyKey , receiver ?: any ) : any ;
54
+ function get < T extends object , P extends PropertyKey > (
55
+ target : T ,
56
+ propertyKey : P ,
57
+ receiver ?: unknown ,
58
+ ) : P extends keyof T ? T [ P ] : any ;
45
59
46
60
/**
47
61
* Gets the own property descriptor of the specified object.
48
62
* An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.
49
63
* @param target Object that contains the property.
50
64
* @param propertyKey The property name.
51
65
*/
52
- function getOwnPropertyDescriptor ( target : object , propertyKey : PropertyKey ) : PropertyDescriptor | undefined ;
66
+ function getOwnPropertyDescriptor < T extends object , P extends PropertyKey > (
67
+ target : T ,
68
+ propertyKey : P ,
69
+ ) : TypedPropertyDescriptor < P extends keyof T ? T [ P ] : any > | undefined ;
53
70
54
71
/**
55
72
* Returns the prototype of an object.
@@ -91,6 +108,12 @@ declare namespace Reflect {
91
108
* @param receiver The reference to use as the `this` value in the setter function,
92
109
* if `target[propertyKey]` is an accessor property.
93
110
*/
111
+ function set < T extends object , P extends PropertyKey > (
112
+ target : T ,
113
+ propertyKey : P ,
114
+ value : P extends keyof T ? T [ P ] : any ,
115
+ receiver ?: any ,
116
+ ) : boolean ;
94
117
function set ( target : object , propertyKey : PropertyKey , value : any , receiver ?: any ) : boolean ;
95
118
96
119
/**
0 commit comments