| 1 |
import { TSSettings } from "./settings"; |
| 2 |
|
| 3 |
export type CanBeInvalid = TSSettings extends { throwOnInvalid: true } ? false : true; |
| 4 |
|
| 5 |
export type DefaultValidity = CanBeInvalid extends true ? boolean : true; |
| 6 |
|
| 7 |
export type IfValid<ValidType, InvalidType, ThisIsValid extends boolean | undefined> = ThisIsValid extends true |
| 8 |
? ValidType |
| 9 |
: ThisIsValid extends false ? InvalidType |
| 10 |
: CanBeInvalid extends true ? ValidType | InvalidType |
| 11 |
: ValidType; |
| 12 |
|
| 13 |
export type Valid = true; |
| 14 |
export type Invalid = false; |