Skip to main content
Module

x/ts_toolbelt_unofficial/mod.ts>F.Return

👷 TypeScript's largest type utility library, now on Deno
Latest
type alias F.Return
import { type F } from "https://deno.land/x/ts_toolbelt_unofficial@1.1.0/mod.ts";
const { Return } = F;

Extract the return type of a [[Function]]

Examples

Example 1

import {F} from 'ts-toolbelt.ts'

const fn = () => true

type test0 = F.ReturnOf<typeof fn>  // boolean

type test1 = F.ReturnOf<() => true> // true
definition: F extends ((...args: List) => infer R) ? R : never