Deferred.d.ts 580 B

12345678910111213141516171819
  1. import '../_version.js';
  2. /**
  3. * The Deferred class composes Promises in a way that allows for them to be
  4. * resolved or rejected from outside the constructor. In most cases promises
  5. * should be used directly, but Deferreds can be necessary when the logic to
  6. * resolve a promise must be separate.
  7. *
  8. * @private
  9. */
  10. declare class Deferred<T> {
  11. promise: Promise<T>;
  12. resolve: (value?: T) => void;
  13. reject: (reason?: any) => void;
  14. /**
  15. * Creates a promise and exposes its resolve and reject functions as methods.
  16. */
  17. constructor();
  18. }
  19. export { Deferred };