Options
All
  • Public
  • Public/Protected
  • All
Menu

Type aliases

Type aliases

Await

Await<P>: P extends Promise<infer A> ? A : P

Get the result type of a Promise

Type parameters

  • P: any

    A promise

returns

[[Any]]

example

import {C} from 'ts-toolbelt'

const promise = new Promise<string>((res, rej) => res('x'))

type test0 = C.Await<typeof promise>  // string
type test1 = C.Await<Promise<number>> // number

  • Inherited
  • Protected
  • Private
  • Static
  • Module
  • Object
  • Property
  • Function
  • Variable
  • Index
  • Type
  • Class
  • Interface
  • Enum
  • Constructor
  • Getter/Setter
Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.