export type IsOptional = T extends `${string}?` ? true : false; export type ToOptional = T extends `${infer Arg}?` ? `${Arg}?` : `${T}?`; export type ToOptionalArray = T extends readonly [infer Head extends string, ...infer Rest extends readonly string[]] ? [ToOptional, ...ToOptionalArray] : []; export type ToRequired = T extends `${infer Arg}?` ? Arg : T; export type ToRequiredArray = T extends readonly [infer Head extends string, ...infer Rest extends readonly string[]] ? [ToRequired, ...ToRequiredArray] : T; export type ReadonlyArrayNormalized> = TArr extends ReadonlyArray ? ReadonlyArray : never; export type ArgValue = string | number | boolean; export type ArgumentInfo = { raw: string; name: string; index: number; isOptional: boolean; }; export type TemplateTransformOptions = { prefix: string; suffix: string; optionalSuffix: string; }; export type TransformFunction = (value: TValue, info: ArgumentInfo) => string; export type TemplateTransform = string | Partial | TransformFunction; export type TransformMap = { [K in A[number]]?: TransformFunction; };