From a60a6f311ff53dd46292710f333b5a9f8244dbea Mon Sep 17 00:00:00 2001 From: Nicolas DUBIEN Date: Tue, 5 Mar 2019 13:03:57 +0100 Subject: [PATCH] Better typings of Object.keys when keys coming from enum --- lib/lib.es5.d.ts | 6 ++++++ src/lib/es5.d.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/lib.es5.d.ts b/lib/lib.es5.d.ts index dda476e4e3957..5d3591ae40282 100644 --- a/lib/lib.es5.d.ts +++ b/lib/lib.es5.d.ts @@ -254,6 +254,12 @@ interface ObjectConstructor { */ isExtensible(o: any): boolean; + /** + * Returns the names of the enumerable properties and methods of an object. + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + keys(o: { [K in EnumType]: any }): EnumType[]; + /** * Returns the names of the enumerable properties and methods of an object. * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 4112f5a2ae7d7..28dea0bb371f7 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -234,6 +234,12 @@ interface ObjectConstructor { */ isExtensible(o: any): boolean; + /** + * Returns the names of the enumerable properties and methods of an object. + * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. + */ + keys(o: { [K in EnumType]: any }): EnumType[]; + /** * Returns the names of the enumerable properties and methods of an object. * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.