//#region src/types.d.ts
/**
 * Compiled lookup tables consumed by the engine. Generated by the compiler
 * (`scripts/compile-tables.mjs`) — flat typed arrays plus string pools; see
 * the compiler for the encoding.
 */
interface Tables {
  /** number of static conflict groups */
  GROUP_COUNT: number;
  /** CSR: node → [start,end) range into edge arrays */
  edgeStart: Int32Array;
  /** CSR: edge → [start,end) range into labelText */
  labelStart: Int32Array;
  /** radix-edge label characters, concatenated */
  labelText: string;
  /** edge → target node */
  edgeTarget: Int32Array;
  /** node → group id (0 = none) offset by 1 */
  nodeGroup: Int32Array;
  /** node → validator-list id (-1 = none) */
  nodeVlist: Int32Array;
  /** CSR: validator-list pattern → [start,end) into vlistOps */
  vlistPat: Int32Array;
  /** validator opcodes */
  vlistOps: Int32Array;
  /** validator-list → op pattern id */
  vlistRef: Int32Array;
  /** flat per-list group ids (delta-coded at generation) */
  vlistGroup: Int32Array;
  /** lifted-literal entry → anchor node */
  litAnchor: Int32Array;
  /** lifted-literal entry → group id */
  litGroup: Int32Array;
  /** lifted-literal entry → pool string id */
  litPool: Int32Array;
  /** pool string id → (offset, length) pairs into poolText */
  poolOffsets: Int32Array;
  /** deduplicated literal tail text */
  poolText: string;
  /** conflict adjacency: row → source group id */
  adjGid: Int32Array;
  /** CSR: row → [start,end) into adjTgt */
  adjStart: Int32Array;
  /** overridden group ids */
  adjTgt: Int32Array;
  /** postfix-extra conflict pairs (conflictingClassGroupModifiers) */
  patGid: Int32Array;
  patTgt: Int32Array;
  /** groups participating in postfix re-lookup (postfixLookupClassGroups) */
  postfixLookupGroups: Int32Array;
  /** names of validators not compiled to span opcodes (custom configs) */
  customValidatorNames: string[];
  /** space-separated order-sensitive variant names */
  orderSensitiveModifiers: string;
  /** optional Tailwind v4 prefix baked into the tables */
  prefix?: string;
}
interface EngineOptions {
  /** whole-string result cache size; 0 disables (default 500) */
  cacheSize?: number;
  /** Tailwind v4 prefix (`tw` matches `tw:hover:p-4`); overrides tables */
  prefix?: string;
}
/** implementations for validators named in `Tables.customValidatorNames` */
type ValidatorImpls = Record<string, (value: string) => boolean>;
/** tailwind-merge `twJoin`/`twMerge` argument shape (strings + nested arrays) */
type ClassNameValue = ClassNameArray | string | null | undefined | 0 | 0n | false;
type ClassNameArray = readonly ClassNameValue[];
/** clsx argument shape (adds numbers and object syntax) */
type ClassValue = ClassArray | ClassDictionary | string | number | bigint | null | boolean | undefined;
type ClassArray = ClassValue[];
interface ClassDictionary {
  [id: string]: any;
}
interface Engine {
  /** variadic merge, `twMerge`-compatible (strings + nested arrays) */
  merge: (...inputs: ClassNameValue[]) => string;
  /** merge one already-joined class string */
  mergeString: (input: string) => string;
  /**
   * doorkeeper probe for a string that was just built: records this
   * sighting and reports whether an earlier one exists. A first sighting
   * is best merged with `mergeUncached` and not cached anywhere.
   */
  seenBefore: (input: string) => boolean;
  /** merge one string, bypassing the whole-string cache */
  mergeUncached: (input: string) => string;
}
/** what `wrapClsx` needs from an engine to handle freshly joined strings */
type FreshMerge = Pick<Engine, "seenBefore" | "mergeUncached">;
/** the `cn` function shape: clsx arguments, merged output */
type CnFunction = (...inputs: ClassValue[]) => string;
//#endregion
export { ClassArray, ClassDictionary, ClassNameArray, ClassNameValue, ClassValue, CnFunction, Engine, EngineOptions, FreshMerge, Tables, ValidatorImpls };