diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 2c457a432c6..e402a96fade 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -180,7 +180,7 @@ interface ObjectConstructor { * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. * @param o Object on which to lock the attributes. */ - freeze(o: T): T; + freeze(o: T): Readonly; /** * Prevents the addition of new properties to an object. @@ -1343,6 +1343,34 @@ interface ArrayLike { readonly [n: number]: T; } +/** + * Make all properties in T optional + */ +type Partial = { + [P in keyof T]?: T[P]; +}; + +/** + * Make all properties in T readonly + */ +type Readonly = { + readonly [P in keyof T]: T[P]; +}; + +/** + * From T pick a set of properties K + */ +type Pick = { + [P in K]: T[P]; +} + +/** + * Construct a type with a set of properties K of type T + */ +type Record = { + [P in K]: T; +} + /** * Represents a raw buffer of binary data, which is used to store data for the * different typed arrays. ArrayBuffers cannot be read from or written to directly,