call-to-promise
Version:
A lightweight, production-ready, universal library for transforming callback-style functions into Promise-based ones. Works seamlessly across Node.js, Deno, and browsers.
19 lines • 586 B
TypeScript
export function defer(): SimpleDeferred;
export type TypeFnIsSameObjectAs = Function;
/**
* This type describes main object of this module.
*/
export type SimpleDeferred = {
isPending: () => boolean;
isSucceed: () => boolean;
isFailed: () => boolean;
isSameObjectAs: TypeFnIsSameObjectAs;
promise: Promise<any>;
resolve: (any: any) => void;
reject: (any: any) => void;
};
/**
* This callback type notify about the action and it's status/result.
*/
export type BooleanNotifierCallback = (result: boolean) => void;
//# sourceMappingURL=simpledefer.d.ts.map