Skip to content

Commit f5ab9d7

Browse files
committed
change type definition for Object.create
1 parent 6dcd587 commit f5ab9d7

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/lib/es5.d.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,24 @@ interface ObjectConstructor {
136136
*/
137137
getOwnPropertyNames(o: any): string[];
138138

139+
/**
140+
* Creates an object that has null prototype.
141+
* @param o Object to use as a prototype. May be null
142+
*/
143+
create(o: null): any;
144+
145+
/**
146+
* Creates an object that has the specified prototype, and that optionally contains specified properties.
147+
* @param o Object to use as a prototype. May be null
148+
*/
149+
create<T>(o: T): T;
150+
139151
/**
140152
* Creates an object that has the specified prototype, and that optionally contains specified properties.
141153
* @param o Object to use as a prototype. May be null
142154
* @param properties JavaScript object that contains one or more property descriptors.
143155
*/
144-
create(o: any, properties?: PropertyDescriptorMap): any;
156+
create(o: any, properties: PropertyDescriptorMap): any;
145157

146158
/**
147159
* Adds a property to an object, or modifies attributes of an existing property.

0 commit comments

Comments
 (0)