/** * All the parameters except the first one. */ export type ParametersExceptFirst = T extends (...args: [any, ...infer P]) => any ? P : never; /** * All the parameters of a function, except the last one. */ export type ParametersExceptLast = T extends (...args: [...infer P, any]) => any ? P : never; /** * All the parameters of a function, except the first and last ones. */ export type ParametersExceptFirstAndLast = T extends (...args: [any, ...infer P, any]) => any ? P : never; /** * The last parameter of a function. */ export type LastParameter = T extends (...args: [...infer _P, infer Last]) => any ? Last : never; /** * The parameters of a function. */ export type Params = T extends (...args: infer P) => any ? P : never; /** * The return type of a function. */ export type Return = T extends (...args: any[]) => infer Ret ? Ret : never; /** * The same type as T, but with the specified keys required. */ export type RequireField = T & { [P in K]-?: T[P]; }; /** * A result that can either have a value or an error. */ export type Result = { readonly success: true; readonly value: ValueT; } | { readonly success: false; readonly error: ErrorT; }; /** * Returns the keys of T tht don't map to never. */ export type NonNeverKeys = { [K in keyof T]: T[K] extends never ? never : K; }[keyof T]; //# sourceMappingURL=utils.d.ts.map