
import { ConfigurablePropertiesName, SelectedConfigurableProperty } from "../properties.js";
import { LayerConfig, PossibleStatesWithRest } from "../types/ComponentConfig.js";

//#region ../automated-config/dist/utils/resolvePropertyStates.d.ts
//#region src/utils/resolvePropertyStates.d.ts
type AnyProperty = SelectedConfigurableProperty<ConfigurablePropertiesName, string>;
/**
 * Yields every modifier subset of size 1..maxSize, preserving input order
 * within each subset. Used by both the resolver and the docs-class
 * enumeration so the depth they support stays in lock-step.
 *
 * Generic over the element type so callers passing `ModifierAtomic[]` get
 * `Generator<readonly ModifierAtomic[]>` back — keeps the inferred type chain
 * tight enough for downstream consumers to avoid widening to `string`.
 */
/**
 * Returns all canonical state keys a property reacts to, in cascade order:
 *
 *   rest → atomics (sorted by global `STATE_PRIORITY`, weakest first)
 *   → 2-atom compounds → 3-atom compounds → ...
 *
 * Cross-rank ordering (atom < 2-atom compound < 3-atom compound < ...) is
 * enforced by CSS class-count specificity. Each atom selector contributes
 * (0,1,0), so a 2-atom compound at (0,3,0) strictly beats a 1-atom rule at
 * (0,2,0) — the cascade-cancellation feature is encoded in the selector
 * itself rather than rule source order.
 *
 * Intra-rank ties (which atom wins among the priority-sorted set, or which
 * 2-atom compound wins among siblings of the same size) fall through to
 * source order at the same specificity. Emission order follows the global
 * `STATE_PRIORITY` array — to change which atom wins between any two
 * simultaneously-matching atoms, reorder that array.
 *
 * Resolution sources, in order of precedence:
 *
 *   1. The new system: `layer.atomicStates` declares the atoms this layer can
 *      compose; `property.excludeAtomics` opts the property out of selected
 *      atoms. Compounds are auto-generated from the resulting set via
 *      modifier × interactive expansion.
 *   2. The legacy system: `property.pseudoStates` (no compound generation; the
 *      array is used verbatim). Used when `layer.atomicStates` is absent so
 *      unmigrated component configs continue to behave exactly as before.
 *
 * `'rest'` is always included unless the property has `skipRestState: true`.
 */
declare function resolvePropertyStates(layer: LayerConfig, property: AnyProperty): PossibleStatesWithRest[]; //#endregion
//#endregion
export { resolvePropertyStates };