Type Alias RequireNonVoid<NonVoid, SuccessType, ErrorType>

RequireNonVoid: void extends NonVoid
    ? NonVoid extends void ? ErrorType : SuccessType
    : SuccessType

Require that the given NonVoid parameter is not void. If it is void, the ErrorType or an error string type is returned. If it not void, the given SuccessType is returned.

Type Parameters

  • NonVoid
  • SuccessType
  • ErrorType = "Input should not be void"