Skip to content

Latest commit

 

History

History
33 lines (30 loc) · 989 Bytes

es2015.promise.d.ts.md

File metadata and controls

33 lines (30 loc) · 989 Bytes

es2015.promise.d.ts Diffs

Index: es2015.promise.d.ts
===================================================================
--- es2015.promise.d.ts
+++ es2015.promise.d.ts
@@ -1,19 +1,20 @@
 interface PromiseConstructor {
   /**
    * A reference to the prototype.
    */
-  readonly prototype: Promise<any>;
-
+  readonly prototype: Promise<unknown>;
   /**
    * Creates a new Promise.
    * @param executor A callback used to initialize the promise. This callback is passed two arguments:
    * a resolve callback used to resolve the promise with a value or the result of another promise,
    * and a reject callback used to reject the promise with a provided reason or error.
    */
   new <T>(
     executor: (
-      resolve: (value: T | PromiseLike<T>) => void,
+      resolve: undefined extends T
+        ? (value?: T | PromiseLike<T>) => void
+        : (value: T | PromiseLike<T>) => void,
       reject: (reason?: any) => void,
     ) => void,
   ): Promise<T>;