@trellixio/roaster-coffee
Version:
Beans' product component library
37 lines • 1.15 kB
TypeScript
/**
* Takes an arbitrary number of arguments and returns a space-separated string of class names.
* Arguments can be strings, numbers, arrays, or objects. Arrays can be nested and will be flattened.
* Objects should have keys as class names and values as booleans, indicating whether the class should be included.
*
* @remarks
* This function can be used to simplify the process of building class names in a dynamic and conditional way.
*
* @param args - The input arguments to be processed for class names.
* @returns A space-separated string of class names.
*
* @example
* ```typescript
* // returns 'class1 class2'
* classNames('class1', 'class2');
* ```
*
* @example
* ```typescript
* // returns 'class1 class2'
* classNames('class1', ['class2']);
* ```
*
* @example
* ```typescript
* // returns 'class1 class2'
* classNames('class1', { class2: true });
* ```
*
* @example
* ```typescript
* // returns 'class1 class2 class3 class4'
* classNames('class1', ['class2', { class3: true }], { class4: true });
* ```
*/
export declare function classNames(...args: any[]): string;
//# sourceMappingURL=index.d.ts.map