arto
Version:
Arto is a flexible and type-safe class name management library for building scalable UIs with variants, states, and conditional styling.
15 lines • 808 B
TypeScript
import { ClassName } from '../types';
/**
* Normalizes a `ClassName<TContext>` into a flattened, deduplicated array of strings.
* - Flattens nested arrays.
* - Invokes callbacks with optional context.
* - Skips duplicates and prevents infinite loops from cyclic callbacks.
*
* @template TContext - The context passed to class generator functions.
* @param classInput - The input (string, array, or function returning class names).
* @param context - An optional context object for generator functions.
* @returns A deduplicated array of class names.
* @throws If a callback throws an error while generating classes.
*/
export declare const normalizeClassName: <TContext = unknown>(classInput: ClassName<TContext>, context?: TContext) => string[];
//# sourceMappingURL=normalize-class-name.d.ts.map