export type Json = string | number | boolean | null | { [key: string]: Json; } | Json[]; export type KeysOfType = { [K in keyof T]: T[K] extends U ? K : never; }[keyof T]; export type RequiredKeys = Exclude>, undefined>; export type OptionalKeys = Exclude, RequiredKeys>; export type Keys = Extract; export type StringEndsWith = TString extends `${string}${TEnd}` ? true : false; /** * Removes the last parameter of a tuple type * * See https://stackoverflow.com/questions/72299206/typescript-how-to-remove-the-last-parameter-of-a-function-type */ export type Pop = T extends [...infer U, any] ? U : never; /** * Removes the first parameter of a tuple type * * Made based on pop */ export type Shift = T extends [any, ...infer U] ? U : never; /** * Removes promise from a type * * Examples: * * ```ts type X = WithoutPromise> //X is string type Y = WithoutPromise // Y is string ``` */ export type WithoutPromise = T extends Promise ? U : T; /** * Adds promise from a type if it's not there yet */ export type WithPromise = T extends Promise ? Promise : Promise; //# sourceMappingURL=types.d.ts.map