/** * @public */ export type ArrayElement = A extends readonly (infer T)[] ? T : never /** * @public */ export type NormalizeReadOnlyArray = T extends readonly [infer NP, ...infer Rest] ? [NP, ...Rest] : T extends readonly (infer NP)[] ? NP[] : T /** * @public */ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Generic utility type that needs to accept any type export type AnyArray = readonly T[] | T[] /** * @public */ export type Optional = Omit & Partial> /** * @public */ // Similar to Arrify only that it preserves tuple information export type Tuplify = T extends readonly [infer NP, ...infer Rest] ? [NP, ...Rest] : T extends readonly (infer NP)[] ? NP[] : [T]