From f5ab9d7289a459edb695277a812e9d2a6e1a2830 Mon Sep 17 00:00:00 2001 From: york yao Date: Mon, 6 Jun 2016 07:22:37 +0800 Subject: [PATCH] change type definition for Object.create --- src/lib/es5.d.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index dfd2bd4ff0c..8447b31fc89 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -136,12 +136,24 @@ interface ObjectConstructor { */ getOwnPropertyNames(o: any): string[]; + /** + * Creates an object that has null prototype. + * @param o Object to use as a prototype. May be null + */ + create(o: null): any; + + /** + * Creates an object that has the specified prototype, and that optionally contains specified properties. + * @param o Object to use as a prototype. May be null + */ + create(o: T): T; + /** * Creates an object that has the specified prototype, and that optionally contains specified properties. * @param o Object to use as a prototype. May be null * @param properties JavaScript object that contains one or more property descriptors. */ - create(o: any, properties?: PropertyDescriptorMap): any; + create(o: any, properties: PropertyDescriptorMap): any; /** * Adds a property to an object, or modifies attributes of an existing property.