Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

async-return-type.d.ts 715B

1234567891011121314151617181920212223
  1. import {PromiseValue} from './promise-value';
  2. type AsyncFunction = (...args: any[]) => Promise<unknown>;
  3. /**
  4. Unwrap the return type of a function that returns a `Promise`.
  5. There has been [discussion](https://github.com/microsoft/TypeScript/pull/35998) about implementing this type in TypeScript.
  6. @example
  7. ```ts
  8. import {AsyncReturnType} from 'type-fest';
  9. import {asyncFunction} from 'api';
  10. // This type resolves to the unwrapped return type of `asyncFunction`.
  11. type Value = AsyncReturnType<typeof asyncFunction>;
  12. async function doSomething(value: Value) {}
  13. asyncFunction().then(value => doSomething(value));
  14. ```
  15. */
  16. export type AsyncReturnType<Target extends AsyncFunction> = PromiseValue<ReturnType<Target>>;