/** * Allows a function to be async or sync. */ export type Awaitable = T | Promise; /** * Removes all `Promise` wrappers from a type. */ export type UnPromisify = T extends Promise ? UnPromisify : T; /** * Provides the return type of a function while applying the `UnPromisify` utility. */ export type CleanReturnType any> = UnPromisify>; /** * Provides the `keyof` union type of a `Record` with `number | symbol` excluded. */ export type CleanKeyOf> = Extract; type IsEqual = (() => G extends T ? 1 : 2) extends () => G extends U ? 1 : 2 ? true : false; /** * Filter out keys from an object. */ type Filter = IsEqual extends true ? never : KeyType extends ExcludeType ? never : KeyType; /** * Create a type from an object type without certain keys. */ export type Except = { [KeyType in keyof ObjectType as Filter]: ObjectType[KeyType]; }; /** * Ensure a number is a positive whole number. */ export type PositiveWholeNumber = `${Num}` extends `-${string}` | `${string}.${string}` | '0' ? never : Num; export {};