/** * Asserts at compile time that the provided type argument's type resolves to the expected boolean literal type. * @param expectTrue - True if the passed in type argument resolved to true. */ export declare function typeAssert(expectTrue: T): void; /** * Asserts at compile time that the provided type argument's type resolves to true. */ export type AssertTrue = never; /** * Asserts at compile time that the provided type argument's type resolves to false. */ export type AssertFalse = never; /** * Asserts at compile time that the provided type argument's type resolves to the expected boolean literal type. */ export type Assert = never; /** * Checks if type `T` has the specified type `U`. */ export type Has = IsAny extends true ? true : IsAny extends true ? false : Extract extends never ? false : true; /** * Checks if type `T` does not have the specified type `U`. */ export type NotHas = Has extends false ? true : false; /** * Checks if type `T` is possibly null or undefined. */ export type IsNullable = Extract extends never ? false : true; /** * Checks if type `T` exactly matches type `U`. */ export type IsExact = TupleMatches, AnyToBrand> extends true ? TupleMatches, DeepMakeRequiredForIsExact> extends true ? true : false : false; type DeepMakeRequiredForIsExact = { [P in keyof T]-?: DeepMakeRequiredForIsExact>; }; /** * Checks if type `T` is the `any` type. */ export type IsAny = 0 extends 1 & T ? true : false; /** * Checks if type `T` is the `never` type. */ export type IsNever = [T] extends [never] ? true : false; /** * Checks if type `T` is the `unknown` type. */ export type IsUnknown = IsNever extends false ? T extends unknown ? unknown extends T ? IsAny extends false ? true : false : false : false : false; type TupleMatches = Matches<[T], [U]> extends true ? true : false; type Matches = T extends U ? (U extends T ? true : false) : false; type AnyToBrand = IsAny extends true ? { __conditionalTypeChecksAny__: undefined; } : T; export {};