'use strict'; 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; // eslint-disable-next-line @typescript-eslint/no-explicit-any export type AnyRecord = Record; export type UnknownRecord = Record; // eslint-disable-next-line @typescript-eslint/no-explicit-any export type AnyComponent = ComponentType; type Simplify = { [K in keyof T]: T[K]; } & {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any 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; };