File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ interface ObjectConstructor {
180
180
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
181
181
* @param o Object on which to lock the attributes.
182
182
*/
183
- freeze < T > ( o : T ) : T ;
183
+ freeze < T > ( o : T ) : Readonly < T > ;
184
184
185
185
/**
186
186
* Prevents the addition of new properties to an object.
@@ -1343,6 +1343,34 @@ interface ArrayLike<T> {
1343
1343
readonly [ n : number ] : T ;
1344
1344
}
1345
1345
1346
+ /**
1347
+ * Make all properties in T optional
1348
+ */
1349
+ type Partial < T > = {
1350
+ [ P in keyof T ] ?: T [ P ] ;
1351
+ } ;
1352
+
1353
+ /**
1354
+ * Make all properties in T readonly
1355
+ */
1356
+ type Readonly < T > = {
1357
+ readonly [ P in keyof T ] : T [ P ] ;
1358
+ } ;
1359
+
1360
+ /**
1361
+ * From T pick a set of properties K
1362
+ */
1363
+ type Pick < T , K extends keyof T > = {
1364
+ [ P in K ] : T [ P ] ;
1365
+ }
1366
+
1367
+ /**
1368
+ * Construct a type with a set of properties K of type T
1369
+ */
1370
+ type Record < K extends string | number , T > = {
1371
+ [ P in K ] : T ;
1372
+ }
1373
+
1346
1374
/**
1347
1375
* Represents a raw buffer of binary data, which is used to store data for the
1348
1376
* different typed arrays. ArrayBuffers cannot be read from or written to directly,
You can’t perform that action at this time.
0 commit comments