Accept generics for defineProperty (#42424)

* Accept generics for defineProperty

Both `Object.defineProperty()` and `Object.defineProperties()` return their
first argument. Use a generic so that typings can be passed through.

* Update baselines

* update missed baseline

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
This commit is contained in:
Matthew Pietz
2021-03-11 07:57:42 -08:00
committed by GitHub
parent 71661b932a
commit dcaefe732e
21 changed files with 174 additions and 174 deletions

4
src/lib/es5.d.ts vendored
View File

@@ -177,14 +177,14 @@ interface ObjectConstructor {
* @param p The property name.
* @param attributes Descriptor for the property. It can be for a data property or an accessor property.
*/
defineProperty(o: any, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): any;
defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;
/**
* Adds one or more properties to an object, and/or modifies attributes of existing properties.
* @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.
* @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.
*/
defineProperties(o: any, properties: PropertyDescriptorMap & ThisType<any>): any;
defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;
/**
* Prevents the modification of attributes of existing properties, and prevents the addition of new properties.