
import { PurgeStats } from "./types.js";

//#region src/purger/optimized/purgeFromCode.d.ts
interface PurgeFromCodeResult {
  safelist: string[];
  imports: string[];
  components: string[];
  stats: PurgeStats;
}
/**
 * Serialized component info from pre-generated data
 */
interface SerializedComponentInfo {
  name: string;
  defaultProps: Record<string, string>;
  getStylesLiterals: Record<string, string>;
  cxLiterals?: string[];
  internalComponents: string[];
  internalComponentProps: Record<string, Record<string, string[]>>;
  propToVariantKeys: Record<string, string[]>;
}
/**
 * Optimized purge from code string.
 *
 * This is a standalone implementation that:
 * - Analyzes UDS component source files to get accurate default props
 * - Includes defaults from internally used components
 * - Only depends on variants from src/styles/variants.ts (source of truth)
 * - Uses ts-morph for AST analysis
 *
 * Key behaviors:
 * - Includes classes for component default props (analyzed from source)
 * - Includes defaults for internal component dependencies
 * - Includes classes for explicitly used prop values
 * - Resolves ternary/logical expressions to extract all possible values
 * - Traces spreads to const objects in the same file
 * - Does NOT fall back to type properties for unresolved spreads
 */
/**
 * Variant defaults per component from consumer's config
 * e.g., { Button: { size: 'md', variant: 'primary' }, Avatar: { size: 'md' } }
 */
type VariantDefaults = Record<string, Record<string, string>>;
interface PurgeFromCodeOptions {
  colorModes?: ('dark' | 'light')[];
  /** Variant defaults from consumer's config - used to include default CSS when prop not specified */
  variantDefaults?: VariantDefaults;
  variants: Record<string, Record<string, string>>;
  autoVariants: Record<string, Record<string, string>>;
  componentData: Record<string, SerializedComponentInfo>;
  includeAllClassNamePrimitives?: boolean;
  filePath?: string;
}
declare const purgeFromCodeOptimized: (code: string, options: PurgeFromCodeOptions) => Promise<PurgeFromCodeResult>;
//#endregion
export { type PurgeFromCodeResult, purgeFromCodeOptimized };
//# sourceMappingURL=purgeFromCode.d.ts.map