import type { ComponentType } from 'react'; export type Maybe = T | null | undefined; /** * Makes only mutable types (objects, arrays) readonly while leaving primitive * types unchanged. This prevents type issues caused by making other types * readonly, like Readonly which isn't the same as string. */ export type NonMutable = T extends object ? Readonly : T; export type UnknownRecord = Record; export type AnyComponent = ComponentType; export type Simplify = { [K in keyof T]: T[K]; } & {}; export type RequireAtLeastOne = { [K in Keys]-?: Required> & Partial>; }[Keys]; type ConvertValueToArray = Simplify<(T extends any[] ? T[number] : T)[]>; export type ConvertValuesToArrays = { [K in keyof T]-?: ConvertValueToArray>; }; export type ConvertValuesToArraysWithUndefined = { [K in keyof T]-?: ConvertValueToArray; }; type AllKeys = U extends unknown ? keyof U : never; /** * Turns a tuple of object shapes into a union whose members are mutually * exclusive: choosing one member forbids every key that belongs only to the * others (each such key becomes `?: never`). Use it instead of hand-writing the * `?: never` fields. * * @example * `MutuallyExclusiveUnion<[{ x: number }, { y: number }]>` resolves to * `{ x: number; y?: never } | { y: number; x?: never }`. */ export type MutuallyExclusiveUnion, Processed extends ReadonlyArray = []> = T extends readonly [infer First, ...infer Rest] ? Simplify<(First & { [K in Exclude, keyof First>]?: never; }) | MutuallyExclusiveUnion> : never; export {}; //# sourceMappingURL=helpers.d.ts.map