Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/actionify/src/deps/types.ts>AsyncReturnType

Create and manage your GitHub workflows with TypeScript and Deno.
Latest
type alias AsyncReturnType
import { type AsyncReturnType } from "https://deno.land/x/actionify@0.3.0/src/deps/types.ts";

Unwrap the return type of a function that returns a Promise.

There has been discussion about implementing this type in TypeScript.

Examples

Example 1

import type {AsyncReturnType} from 'type-fest';
import {asyncFunction} from 'api';

// This type resolves to the unwrapped return type of `asyncFunction`.
type Value = AsyncReturnType<typeof asyncFunction>;

async function doSomething(value: Value) {}

asyncFunction().then(value => doSomething(value));

Type Parameters

Target extends AsyncFunction
definition: PromiseValue<ReturnType<Target>>