export type Partial = { [P in keyof T]?: T[P]; }; export type Pick = { [P in K]: T[P]; }; export type Exclude = T extends U ? never : T; export type Omit = Pick>; export type ToArray = V extends any[] ? V : V[]; export type ReplaceProps = Omit, P> & P; /** * Prepend arguments to function * Useful for prepend `newValue` arg to native `onChange` callbacks * * @see https://stackoverflow.com/a/69668215 * @example * * type SomeFunc = (a: string, b: number, c: someCustomType) => number; * type SomeFuncAltered = PrependParameters; * // SomeFuncAltered = (d: number, a:string, b:number, c:someCustomType) => number; */ export type PrependParameters any, TParameters extends [...args: any]> = (...args: [...TParameters, ...Parameters]) => ReturnType;