/** * @typedef {(string | { [key: string]: boolean } | Array)} ClassNameInput * Represents an individual class name, a mapping of class names to booleans, * or an array of such values. In the mapping or array, if the value is true, * the corresponding key will be included in the final class string. */ export type ClassNameInput = string | { [key: string]: boolean; } | Array; /** * @typedef { { [key: string]: string } } ClassNameMap * Represents a mapping from class names to other class names. * This can be used to transform class names. */ export type ClassNameMap = { [key: string]: string; }; /** * @typedef { { [key: string]: { prefix?: string; suffix?: string } } } ClassNamePrefixSuffix * Represents a mapping from class names to objects specifying prefixes and/or suffixes. * This can be used to add prefixes or suffixes to class names. */ export type ClassNamePrefixSuffix = { [key: string]: { prefix?: string; suffix?: string; }; }; /** * @typedef {Object} ClassNameConfig * @property {string} [globalPrefix] - A prefix to add to every class name. * @property {string} [globalSuffix] - A suffix to add to every class name. * @property {string[]} [exclude] - An array of class names to exclude from the final string. * @property {ClassNameMap} [classMap] - A ClassNameMap to transform class names. * @property {ClassNamePrefixSuffix} [prefixSuffixMap] - A ClassNamePrefixSuffix to add prefixes and suffixes to class names. * @property {string} [separator] - The string to use to separate class names in the final string. * @property {(className: string) => boolean} [removeIf] - A function that takes a class name and returns a boolean. If it returns true, the class name is not included in the final string. * @property {(className: string) => string | null | undefined} [replaceIf] - A function that takes a class name and returns a string, null or undefined. If it returns a string, the original class name is replaced with this string in the final output. */ export interface ClassNameConfig { globalPrefix?: string; globalSuffix?: string; exclude?: string[]; classMap?: ClassNameMap; prefixSuffixMap?: ClassNamePrefixSuffix; separator?: string; removeIf?: (className: string) => boolean; replaceIf?: (className: string) => string | null | undefined; } /** * Generates a class name string based on the provided ClassNameInputs. * * @param {ClassNameInput[]} args - The class names and/or mappings to include. * @returns {string} - The final class name string. */ declare function className(...args: ClassNameInput[]): string; /** * Generates a class name string based on a ClassNameConfig and the provided ClassNameInputs. * * @param {ClassNameConfig} config - The configuration for generating the class name string. * @param {ClassNameInput[]} args - The class names and/or mappings to include. * @returns {string} - The final class name string. */ declare function classNameAdv(config: ClassNameConfig, ...args: ClassNameInput[]): string; /** * A convenience function that calls className and returns the result in an object under the key 'className'. * * @param {ClassNameInput[]} args - The class names and/or mappings to include. * @returns {{className: string}} - An object with a 'className' key and the final class name string as the value. */ declare function cn(...args: ClassNameInput[]): { className: string; }; /** * A convenience function that calls classNameAdv and returns the result in an object under the key 'className'. * * @param {ClassNameConfig} config - The configuration for generating the class name string. * @param {ClassNameInput[]} args - The class names and/or mappings to include. * @returns {{className: string}} - An object with a 'className' key and the final class name string as the value. */ declare function cnAdv(config: ClassNameConfig, ...args: ClassNameInput[]): { className: string; }; export { className, classNameAdv, cn, cnAdv };