arto
Version:
Arto is a flexible and type-safe class name management library for building scalable UIs with variants, states, and conditional styling.
39 lines • 1.74 kB
TypeScript
import { Plugin, PluginStage } from '../plugin-interface';
import { ClassNameBuilder } from '../classname-builder';
import { VariantValue } from '../types';
/**
* A plugin that applies the top-level `className` property from an Arto configuration
* to the builder at the `'core'` stage, adding any specified base classes.
*
* @template TVariants - A record of variant keys and their possible values.
* @template TStates - A string union of all possible state names.
* @template TContext - Optional context type for class generation or plugin logic.
*/
export declare class BaseClassNamePlugin<TVariants extends Record<string, VariantValue> = Record<string, VariantValue>, TStates extends string = string, TContext = unknown> implements Plugin<TVariants, TStates, TContext> {
/**
* A unique identifier for this plugin to help with debugging or HMR consistency.
*/
id: string;
/**
* The plugin stage; defaults to `'core'`, meaning it runs alongside Arto's internal logic.
*/
stage: PluginStage;
/**
* The priority order within the `'core'` stage; lower values run first.
* @default 0
*/
order: number;
/**
* Constructs a new `BaseClassNamePlugin`.
* @param order - Numeric order within the 'core' stage (default = 0).
*/
constructor(order?: number);
/**
* Applies the top-level `className` from the Arto configuration to the builder's base classes,
* after normalizing it with `normalizeClassName`.
*
* @param builder - The `ClassNameBuilder` that accumulates class names from all plugins.
*/
apply(builder: ClassNameBuilder<TVariants, TStates, TContext>): void;
}
//# sourceMappingURL=base-classname-plugin.d.ts.map