import { CategoryDef } from '../types'; export declare class CategoryPalette { /** Registered categories (insertion order) */ private readonly _defs; /** Auto-assigned colors for ids not in the initial set */ private readonly _autoColors; /** Fallback palette used for auto-assignment */ private readonly _fallback; /** Counter for round-robin auto-assignment */ private _autoIndex; /** * @param categories - Initial category definitions (id, label, color). * @param fallbackPalette - Optional custom palette for auto-assigned unknowns. * Defaults to the Astro UXDS–compliant Zendir data-viz palette. */ constructor(categories?: CategoryDef[], fallbackPalette?: string[]); /** All registered categories (in insertion order). */ get all(): CategoryDef[]; /** Number of registered categories. */ get size(): number; /** Returns the full definition for a registered id, or `undefined`. */ getCategory(id: string | number): CategoryDef | undefined; /** Returns `true` if the id was registered in the constructor. */ has(id: string | number): boolean; /** * Resolve a color for any id. * - Registered ids → their explicit `color`. * - Unknown ids → stable auto-assigned color from the fallback palette * (same id always gets the same color within this palette instance). */ getColor(id: string | number): string; /** * Resolve a label for any id. * Registered ids → their `label`; unknown ids → the stringified id. */ getLabel(id: string | number): string; /** * Convert a `CategoryDef` array to a palette instance. * Convenience factory — identical to `new CategoryPalette(defs)`. */ static from(defs: CategoryDef[], fallbackPalette?: string[]): CategoryPalette; }