resolvable-promise
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -0,6 +1,7 @@ | ||
import { Executor, Resolvable } from './types'; | ||
declare function Resolvable<T>(handler?: Executor<T>): Resolvable<T>; | ||
declare namespace Resolvable { | ||
var _a: typeof Resolvable; | ||
export { _a as default }; | ||
} | ||
declare type ResolvableConstructor = { | ||
new <T>(promise?: Executor<T>): Resolvable<T>; | ||
<T>(promise?: Executor<T>): Resolvable<T>; | ||
}; | ||
declare const _default: ResolvableConstructor & { | ||
@@ -10,12 +11,1 @@ default: ResolvableConstructor; | ||
export = _default; | ||
interface Resolvable<T> extends Promise<T> { | ||
resolve: Resolve<T>; | ||
reject: Reject; | ||
} | ||
declare type ResolvableConstructor = { | ||
new <T>(promise?: Executor<T>): Resolvable<T>; | ||
<T>(promise?: Executor<T>): Resolvable<T>; | ||
}; | ||
declare type Executor<T> = Promise<T> | ((resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void); | ||
declare type Resolve<T> = (value?: T) => void; | ||
declare type Reject = (reason?: any) => void; |
{ | ||
"name": "resolvable-promise", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Promises with the resolve and reject functions exposed", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -0,1 +1,3 @@ | ||
import { Executor, Reject, Resolvable, Resolve } from './types'; | ||
function Resolvable<T>(handler?: Executor<T>) { | ||
@@ -26,13 +28,2 @@ let resolve!: Resolve<T>; | ||
Resolvable.default = Resolvable; | ||
export = Resolvable as unknown as ResolvableConstructor & { | ||
default: ResolvableConstructor | ||
}; | ||
interface Resolvable<T> extends Promise<T> { | ||
resolve: Resolve<T> | ||
reject: Reject | ||
} | ||
type ResolvableConstructor = { | ||
@@ -43,7 +34,5 @@ new <T>(promise?: Executor<T>): Resolvable<T> | ||
type Executor<T> = | ||
| Promise<T> | ||
| ((resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void); | ||
type Resolve<T> = (value?: T) => void; | ||
type Reject = (reason?: any) => void; | ||
(Resolvable as any).default = Resolvable; | ||
export = Resolvable as unknown as ResolvableConstructor & { | ||
default: ResolvableConstructor | ||
}; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10233
19