Type alias GuardType<Guard>

GuardType<Guard>: Guard extends TypeGuard<infer Input, infer Return> ? Combine<Input, Return> : never

Returns a type that a Guard will assign to a variable.

Example

GuardType<typeof isTypeString> // string
GuardType<typeof Array.isArray> // unknown[]

Type Parameters

  • Guard

Generated using TypeDoc