Skip to content

Latest commit

 

History

History
67 lines (63 loc) · 2.78 KB

File metadata and controls

67 lines (63 loc) · 2.78 KB

es2017.object.d.ts Diffs

Index: es2017.object.d.ts
===================================================================
--- es2017.object.d.ts
+++ es2017.object.d.ts
@@ -2,34 +2,48 @@
   /**
    * Returns an array of values of the enumerable own properties 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.
    */
-  values<T>(o: { [s: string]: T } | ArrayLike<T>): T[];
-
+  values<T>(o: ArrayLike<T>): T[];
   /**
    * Returns an array of values of the enumerable own properties 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.
    */
-  values(o: {}): any[];
+  values<K extends PropertyKey, V>(
+    o: Record<K, V>,
+  ): (string extends K ? V : number extends K ? V : unknown)[];
+  /**
+   * Returns an array of values of the enumerable own properties 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.
+   */
+  values(o: {}): unknown[];
 
   /**
    * Returns an array of key/values of the enumerable own properties 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.
    */
-  entries<T>(o: { [s: string]: T } | ArrayLike<T>): [string, T][];
-
+  entries<T>(o: ArrayLike<T>): [string, T][];
   /**
    * Returns an array of key/values of the enumerable own properties 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.
    */
-  entries(o: {}): [string, any][];
+  entries<K extends PropertyKey, V>(
+    o: Record<K, V>,
+  ): [string, string extends K ? V : number extends K ? V : unknown][];
+  /**
+   * Returns an array of key/values of the enumerable own properties 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.
+   */
+  entries(o: {}): [string, unknown][];
 
   /**
    * Returns an object containing all own property descriptors 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.
    */
-  getOwnPropertyDescriptors<T>(
+  getOwnPropertyDescriptors<T extends {}>(
     o: T,
-  ): { [P in keyof T]: TypedPropertyDescriptor<T[P]> } & {
-    [x: string]: PropertyDescriptor;
+  ): {
+    [P in keyof T]: TypedPropertyDescriptor<T[P]>;
+  } & {
+    [x: PropertyKey]: PropertyDescriptor;
   };
 }