type Splitter = "-" | "_" | "/" | "."; type FirstOfString = S extends `${infer F}${string}` ? F : never; type RemoveFirstOfString = S extends `${string}${infer R}` ? R : never; type IsUpper = S extends Uppercase ? true : false; type IsLower = S extends Lowercase ? true : false; type SameLetterCase = IsUpper extends IsUpper ? true : IsLower extends IsLower ? true : false; type CapitalizedWords = T extends readonly [infer F extends string, ...infer R extends string[]] ? CapitalizedWords : F>}`, Normalize> : Accumulator; type JoinLowercaseWords = T extends readonly [infer F extends string, ...infer R extends string[]] ? Accumulator extends "" ? JoinLowercaseWords}`> : JoinLowercaseWords}`> : Accumulator; type LastOfArray = T extends [...any, infer R] ? R : never; type RemoveLastOfArray = T extends [...infer F, any] ? F : never; type CaseOptions = { normalize?: boolean; }; type SplitByCase = string extends Separator ? string[] : T extends `${infer F}${infer R}` ? [LastOfArray] extends [never] ? SplitByCase : LastOfArray extends string ? R extends "" ? SplitByCase, `${LastOfArray}${F}` ]> : SameLetterCase> extends true ? F extends Separator ? FirstOfString extends Separator ? SplitByCase : IsUpper> extends true ? SplitByCase, Separator, [ ...Accumulator, FirstOfString ]> : SplitByCase : SplitByCase, `${LastOfArray}${F}` ]> : IsLower extends true ? SplitByCase, Separator, [ ...RemoveLastOfArray, `${LastOfArray}${F}`, FirstOfString ]> : SplitByCase : never : Accumulator extends [] ? T extends "" ? [] : string[] : Accumulator; type JoinByCase = string extends T ? string : string[] extends T ? string : T extends string ? SplitByCase extends readonly string[] ? JoinLowercaseWords, Joiner> : never : T extends readonly string[] ? JoinLowercaseWords : never; type PascalCase = string extends T ? string : string[] extends T ? string : T extends string ? SplitByCase extends readonly string[] ? CapitalizedWords, "", Normalize> : never : T extends readonly string[] ? CapitalizedWords : never; type CamelCase = string extends T ? string : string[] extends T ? string : Uncapitalize>; type KebabCase = JoinByCase; type SnakeCase = JoinByCase; type TrainCase = string extends T ? string : string[] extends T ? string : T extends string ? SplitByCase extends readonly string[] ? CapitalizedWords, Joiner> : never : T extends readonly string[] ? CapitalizedWords : never; type FlatCase = JoinByCase; declare function isUppercase(char?: string): boolean | undefined; declare function splitByCase(str: T): SplitByCase; declare function splitByCase(str: T, separators: Separator): SplitByCase; declare function upperFirst(str: S): Capitalize; declare function lowerFirst(str: S): Uncapitalize; declare function pascalCase(): ""; declare function pascalCase(str: T, opts?: CaseOptions): PascalCase; declare function camelCase(): ""; declare function camelCase(str: T, opts?: UserCaseOptions): CamelCase; declare function kebabCase(): ""; declare function kebabCase(str: T): KebabCase; declare function kebabCase(str: T, joiner: Joiner): KebabCase; declare function snakeCase(): ""; declare function snakeCase(str: T): SnakeCase; declare function flatCase(): ""; declare function flatCase(str: T): FlatCase; declare function trainCase(): ""; declare function trainCase(str: T, opts?: UserCaseOptions): TrainCase; declare function titleCase(): ""; declare function titleCase(str: T, opts?: UserCaseOptions): TrainCase; export { type CamelCase, type CaseOptions, type FlatCase, type JoinByCase, type KebabCase, type PascalCase, type SnakeCase, type SplitByCase, type TrainCase, camelCase, flatCase, isUppercase, kebabCase, lowerFirst, pascalCase, snakeCase, splitByCase, titleCase, trainCase, upperFirst };