import { UnpackArray, Func, AsyncFunc } from "./index"; /** * Defines `false` unit type if `T extends true`. * Defines `true` unit type if `T extends false`. * Defines `TIfTIsBool` when `T` is exactly `boolean` type. * * @param T Boolean type to get negation for. * @param TIfTIsBool Resulting type when `T` is exactly of `boolean` type. */ export declare type Not = If<(T), false, true, TIfTIsBool>; /** * Sequentially performs the following logic: * Expands to `TIfTrue` if `TCond extends true`. * Expands to `TElse` if `TCond extends false`. * Expands to `TIfCondIsBool` if `TCond extends boolean`. * * @param TCond Boolean type that controlls which branch to expand to. * @param TIfTrue Defined type if `TCond extends true` branch. * @param TElse Defined type if `TCond extends false` branch. * @param TIfCondIsBool Defined type if `TCond extends boolean`branch. */ export declare type If = (Extends extends true ? TIfTrue : Extends extends true ? TElse : TIfCondIsBool); /** * Defines `true` or `false` according to the definition of `xor` logical operator. */ export declare type Xor = T1 extends T2 ? false : true; /** * Defines `true` or `false` according to the definition of `xnor` logical operator. */ export declare type Equiv = Not>; /** * Defines `true` or `false` according to the definition of `nand` logical operator. * It gets applied to all the argumets in the given tuple type `T`. */ export declare type Nand = Not>; /** * Defines `true` or `false` accroding to the definition of `nor` logical operator. * It gets applied to all the argumets in the given tuple type `T`. */ export declare type Nor = Not>; /** * Defines `true` or `false` accroding to the definition of `and` logical operator. * It gets applied to all the argumets in the given tuple type `T`. */ export declare type And = Not, false>>; /** * Defines `true` or `false` according to the definition of `or` logical operator. * It gets applied to all the argumets in the given tuple type `T`. */ export declare type Or = UnionIncludes, true>; /** * Defines `true` if `TExtender` is assignable to `TExtendee`, otherwise `false`. * @param TExtender Type to check for covariance with `TExtendee`. * @param TExtendee Type to check for contravariance with `TExtender`. * * @remarks * It verifies that you may physically assign a value of type `TExtender` to `TExtendee`. * That's why union types with excess members that are not assignable to `TExtendee` * will evaluate to `false`. */ export declare type Extends = false extends (TExtender extends TExtendee ? true : false) ? false : true; /** * Shorthand for `Not>`. */ export declare type NotExtends = Not>; /** * Defines `true` if the given `TUnion` includes `TValue`. * This type is opposite to `UnionExcludes<>`. * * @param TUnion Union type to search for `TValue` in. * @param TValue Type to match with `TUnion` members. */ export declare type UnionIncludes = Extends>; /** * Defines `false` if the given `TUnion` includes `TValue`. * This type is opposite to `UnionIncludes<>`. * * @param TUnion Union type to search for `TValue` in. * @param TValue Type to match with `TUnion` members. */ export declare type UnionExcludes = IsNever>; /** * Defines `true` if `T1` is exactly `T2`, `false` otherwise. * Even `AreSame` expands to `false`. Only the same types expand to `true`. * Beware that this type works as vanilla `extends` clause with function types, * so comparing functions is not that strict. * * @param T1 Type to strictly compare to `T2`. * @param T2 Type to strictly compare to `T1`. */ export declare type AreSame = (If<(IsAny), IsAny, If<(IsAny), IsAny, And<[UnionIncludes, UnionIncludes, Extends, Extends]>>>); /** * Defines `false` if `TSuspect` is exactly of `unknown` type, `true` otherwise. * @param TSuspect Target type to check. */ export declare type IsNotUnknown = Not>; /** * Defines `true` if `TSuspect` is exactly of `unknown` type, `false` otherwise. * @param TSuspect Target type to check. */ export declare type IsUnknown = And<[IsNotAny, Extends]>; /** * Defines `false` if `TSuspect` is exactly of `any` type, `true` otherwise. * @param TSuspect Target type to check. */ export declare type IsNotAny = Not>; /** * Defines `true` if `TSuspect` is exactly of `any` type, `false` otherwise. * @param TSuspect Target type to check. */ export declare type IsAny = Extends; /** * Defines `false` if `TSuspect` is exactly of `never` type, `true` otherwise. * @param TSuspect Target type to check. */ export declare type IsNotNever = Not>; /** * Defines `true` if `TSuspect` is exactly of `never` type, `false` otherwise. * @param TSuspect Target type to check. */ export declare type IsNever = Extends; /** * Shorthand for `Extends`. * @param TSuspect Target type to check. */ export declare type IsFunc = Extends; /** * Shorthand for `Extends`. * @param TSuspect Target type to check. */ export declare type IsAsyncFunc = Extends; /** * Defines `true` if `TSuspect` contains both `undefined` and `null` types, `false` otherwise. * As a special case, defines `true` when `TSuspect` is `unknown` or `any`, * `false` if `TSuspect` is `never`. * * @param TSuspect Target type to check */ export declare type IsNullable = Or<[IsUnknown, UnionIncludes]>; /** * Defines `true` if `TSuspect` contains `null`, `false` otherwise. * As a special case, defines `true` when `TSuspect` is `unknown` or `any`, * `false` if `TSuspect` is `never`. */ export declare type CanBeNull = Or<[IsUnknown, UnionIncludes]>; /** * Defines `true` if `TSuspect` contains `undefined`, `false` otherwise. * As a special case, defines `true` when `TSuspect` is `unknown` or `any`, * `false` if `TSuspect` is `never`. */ export declare type CanBeUndef = Or<[IsUnknown, UnionIncludes]>; //# sourceMappingURL=logical.d.ts.map