of.d.ts 493 B

12345678910
  1. /**
  2. * Given a promise awaits it and returns a 3-tuple, with the following members:
  3. *
  4. * - First entry is either the resolved value of the promise or `undefined`.
  5. * - Second entry is either the error thrown by promise or `undefined`.
  6. * - Third entry is a boolean, truthy if promise was resolved and falsy if rejected.
  7. *
  8. * @param promise Promise to convert to 3-tuple.
  9. */
  10. export declare const of: <T, E = unknown>(promise: Promise<T>) => Promise<[T | undefined, E | undefined, boolean]>;