import { BrowserContext, Page } from "playwright";

//#region src/types.d.ts
/**
* Theme color definitions for Musea gallery UI.
* All properties are optional — unspecified colors inherit from the `base` built-in theme.
*/
/**
 * Theme color definitions for Musea gallery UI.
 * All properties are optional — unspecified colors inherit from the `base` built-in theme.
 */
interface MuseaThemeColors {
  bgPrimary?: string;
  bgSecondary?: string;
  bgTertiary?: string;
  bgElevated?: string;
  accent?: string;
  accentHover?: string;
  accentSubtle?: string;
  text?: string;
  textSecondary?: string;
  textMuted?: string;
  border?: string;
  borderSubtle?: string;
  success?: string;
  error?: string;
  info?: string;
  warning?: string;
  shadow?: string;
}
/**
 * Custom theme definition.
 */
interface MuseaTheme {
  /** Unique name for this theme. */
  name: string;
  /** Built-in theme to inherit unspecified colors from. @default 'dark' */
  base?: "dark" | "light";
  /** Color overrides. */
  colors: MuseaThemeColors;
}
/**
 * Musea plugin options.
 */
interface MuseaOptions {
  /**
   * Glob patterns to include Art files.
   * @default ['**\/*.art.vue']
   */
  include?: string[];
  /**
   * Glob patterns to exclude.
   * @default ['node_modules/**', 'dist/**']
   */
  exclude?: string[];
  /**
   * Base path for Musea gallery UI.
   * @default '/__musea__'
   */
  basePath?: string;
  /**
   * Enable Storybook CSF output.
   * @default false
   */
  storybookCompat?: boolean;
  /**
   * Storybook output directory (when storybookCompat is true).
   * @default '.storybook/stories'
   */
  storybookOutDir?: string;
  /**
   * Enable inline <art> blocks in regular .vue SFC files.
   * When enabled, regular .vue files containing <art> blocks will be
   * included in the gallery. Use <Self> to reference the host component.
   * @default false
   */
  inlineArt?: boolean;
  /**
   * VRT (Visual Regression Testing) configuration.
   */
  vrt?: VrtOptions;
  /**
   * Path to Style Dictionary tokens JSON file or directory.
   * Supports standard Style Dictionary format.
   * @example 'src/tokens.json' or 'src/tokens/'
   */
  tokensPath?: string;
  /**
   * Gallery theme configuration.
   *
   * - `'dark'` / `'light'` — use a built-in theme (default: `'dark'`)
   * - `'system'` — follow the OS color-scheme preference
   * - `MuseaTheme` — single custom theme (replaces defaults)
   * - `MuseaTheme[]` — multiple custom themes (first is default, user can switch)
   */
  theme?: "dark" | "light" | "system" | MuseaTheme | MuseaTheme[];
  /**
   * CSS files to inject into component preview iframes.
   * Useful for loading global styles (custom properties, resets, fonts, etc.)
   * that components depend on.
   *
   * Paths are resolved relative to the project root.
   * @example ['app/assets/styles/main.css']
   */
  previewCss?: string[];
  /**
   * Path to a module that exports a default setup function for preview iframes.
   * The function receives the Vue `App` instance and can install plugins
   * (e.g. vue-i18n, vue-router) before the component is mounted.
   *
   * Signature: `(app: App) => void | Promise<void>`
   *
   * Path is resolved relative to the project root.
   * @example 'musea.preview.ts'
   */
  previewSetup?: string;
}
/**
 * VRT configuration options.
 */
interface VrtOptions {
  /**
   * Snapshot storage directory.
   * @default '.vize/snapshots'
   */
  snapshotDir?: string;
  /**
   * Pixel difference threshold for comparison.
   * @default 100
   */
  threshold?: number;
  /**
   * Viewports to capture.
   * @default [{ width: 1280, height: 720 }, { width: 375, height: 667 }]
   */
  viewports?: ViewportConfig[];
}
/**
 * Viewport configuration.
 */
interface ViewportConfig {
  /** Width in pixels */
  width: number;
  /** Height in pixels */
  height: number;
  /** Device scale factor */
  deviceScaleFactor?: number;
  /** Viewport name for identification */
  name?: string;
}
/**
 * Art file metadata.
 */
interface ArtMetadata {
  title: string;
  description?: string;
  component?: string;
  category?: string;
  tags: string[];
  status: "draft" | "ready" | "deprecated";
  order?: number;
}
/**
 * Art variant definition.
 */
interface ArtVariant {
  name: string;
  template: string;
  isDefault: boolean;
  skipVrt: boolean;
  args?: Record<string, unknown>;
}
/**
 * Parsed Art file information.
 */
interface ArtFileInfo {
  /** Absolute file path */
  path: string;
  /** Art metadata */
  metadata: ArtMetadata;
  /** Variant definitions */
  variants: ArtVariant[];
  /** Whether file has script setup */
  hasScriptSetup: boolean;
  /** Raw content of the <script setup> block */
  scriptSetupContent?: string;
  /** Whether file has regular script */
  hasScript: boolean;
  /** Number of style blocks */
  styleCount: number;
  /** Whether this art comes from an inline <art> block in a regular .vue file */
  isInline?: boolean;
  /** For inline art: absolute path to the host .vue component file */
  componentPath?: string;
}
/**
 * CSF output from Art transformation.
 */
interface CsfOutput {
  /** Generated CSF code */
  code: string;
  /** Suggested filename */
  filename: string;
}
/**
 * Palette API response.
 */
interface PaletteApiResponse {
  title: string;
  controls: PaletteControl[];
  groups: string[];
  json: string;
  typescript: string;
}
/**
 * Single prop control definition.
 */
interface PaletteControl {
  name: string;
  control: ControlKind;
  default_value?: unknown;
  description?: string;
  required: boolean;
  options: Array<{
    label: string;
    value: unknown;
  }>;
  range?: {
    min: number;
    max: number;
    step?: number;
  };
  group?: string;
}
/**
 * Supported control kinds for the props panel.
 */
type ControlKind = "text" | "number" | "boolean" | "range" | "select" | "radio" | "color" | "date" | "object" | "array" | "file" | "raw";
/**
 * Analysis API response (Props/Emits info).
 */
interface AnalysisApiResponse {
  props: Array<{
    name: string;
    type: string;
    required: boolean;
    default_value?: unknown;
  }>;
  emits: string[];
}
/**
 * Screenshot capture configuration.
 */
interface CaptureConfig {
  /** Capture full page vs viewport only */
  fullPage?: boolean;
  /** Wait for network idle before capture */
  waitForNetwork?: boolean;
  /** Additional wait time after load (ms) */
  settleTime?: number;
  /** CSS selector to wait for */
  waitSelector?: string;
  /** Elements to hide before capture (CSS selectors) */
  hideElements?: string[];
  /** Elements to mask before capture (CSS selectors) */
  maskElements?: string[];
}
/**
 * Image comparison configuration.
 */
interface ComparisonConfig {
  /** Anti-aliasing detection */
  antiAliasing?: boolean;
  /** Alpha channel comparison */
  alpha?: boolean;
  /** Diff image output format */
  diffStyle?: "overlay" | "sideBySide" | "diffOnly" | "animated";
  /** Diff highlight color */
  diffColor?: {
    r: number;
    g: number;
    b: number;
  };
}
/**
 * CI-specific configuration.
 */
interface CiConfig {
  /** Fail build on any diff */
  failOnDiff?: boolean;
  /** Auto-update baselines on main branch */
  autoUpdateOnMain?: boolean;
  /** Generate JSON report for CI */
  jsonReport?: boolean;
  /** Retry failed tests */
  retries?: number;
}
/**
 * Accessibility testing options.
 */
interface A11yOptions {
  /** Enable a11y auditing during VRT */
  enabled?: boolean;
  /** axe-core rules to include */
  includeRules?: string[];
  /** axe-core rules to exclude */
  excludeRules?: string[];
  /** WCAG level (A, AA, AAA) */
  level?: "A" | "AA" | "AAA";
}
/**
 * Accessibility audit result.
 */
interface A11yResult {
  artPath: string;
  variantName: string;
  violations: A11yViolation[];
  passes: number;
  incomplete: number;
}
/**
 * Single accessibility violation.
 */
interface A11yViolation {
  id: string;
  impact: "minor" | "moderate" | "serious" | "critical";
  description: string;
  helpUrl: string;
  nodes: number;
} //#endregion
//#region src/vrt.d.ts

//# sourceMappingURL=types.d.ts.map
/**
 * VRT test result for a single variant.
 */
interface VrtResult {
  artPath: string;
  variantName: string;
  viewport: ViewportConfig;
  passed: boolean;
  snapshotPath: string;
  currentPath?: string;
  diffPath?: string;
  diffPercentage?: number;
  diffPixels?: number;
  totalPixels?: number;
  error?: string;
  isNew?: boolean;
}
/**
 * VRT summary for reporting.
 */
interface VrtSummary {
  total: number;
  passed: number;
  failed: number;
  new: number;
  skipped: number;
  duration: number;
}
/**
 * Extended VRT options aligned with Rust VrtConfig.
 */
interface ExtendedVrtOptions extends VrtOptions {
  capture?: CaptureConfig;
  comparison?: ComparisonConfig;
  ci?: CiConfig;
  /** Enable a11y auditing during VRT */
  a11y?: boolean;
}
/**
 * Pixel comparison options.
 */
interface PixelCompareOptions {
  /** Threshold for color difference (0-1). Default: 0.1 */
  threshold?: number;
  /** Include anti-aliasing in diff. Default: false */
  includeAA?: boolean;
  /** Alpha channel comparison. Default: true */
  alpha?: boolean;
  /** Diff highlight color */
  diffColor?: {
    r: number;
    g: number;
    b: number;
  };
}
/**
 * VRT runner using Playwright.
 */
declare class MuseaVrtRunner {
  private options;
  private capture;
  private comparison;
  private ci;
  private browser;
  private startTime;
  constructor(options?: ExtendedVrtOptions);
  /**
   * Initialize Playwright browser.
   */
  init(): Promise<void>;
  /**
   * Close browser and cleanup.
   */
  close(): Promise<void>;
  /**
   * Run VRT tests for all Art files.
   */
  runAllTests(artFiles: ArtFileInfo[], baseUrl: string): Promise<VrtResult[]>;
  /**
   * Capture screenshot and compare with baseline.
   */
  captureAndCompare(art: ArtFileInfo, variantName: string, viewport: ViewportConfig, baseUrl: string): Promise<VrtResult>;
  /**
   * Get the Playwright Page for external use (e.g., a11y auditing).
   */
  createPage(viewport: ViewportConfig): Promise<{
    page: Page;
    context: BrowserContext;
  }>;
  /**
   * Update baseline snapshots with current screenshots.
   */
  updateBaselines(results: VrtResult[]): Promise<number>;
  /**
   * Approve specific failed results (update their baselines).
   */
  approveResults(results: VrtResult[], pattern?: string): Promise<number>;
  /**
   * Clean orphaned snapshots (no corresponding art/variant).
   */
  cleanOrphans(artFiles: ArtFileInfo[]): Promise<number>;
  /**
   * Get VRT summary statistics.
   */
  getSummary(results: VrtResult[]): VrtSummary;
  /**
   * Build URL for variant preview.
   */
  private buildVariantUrl;
  /**
   * Compare two PNG images and generate a diff image.
   * Returns pixel difference statistics.
   */
  private compareImages;
}
/**
 * Generate VRT report in HTML format.
 * Supports side-by-side, overlay, and slider comparison modes.
 */
declare function generateVrtReport(results: VrtResult[], summary: VrtSummary): string;
/**
 * Generate VRT JSON report for CI integration.
 */
declare function generateVrtJsonReport(results: VrtResult[], summary: VrtSummary): string;

//#endregion
export { A11yOptions, A11yResult, AnalysisApiResponse, ArtFileInfo, ArtMetadata, ArtVariant, CaptureConfig, CiConfig, ComparisonConfig, CsfOutput, ExtendedVrtOptions, MuseaOptions, MuseaTheme, MuseaThemeColors, MuseaVrtRunner as MuseaVrtRunner$1, PaletteApiResponse, PixelCompareOptions, ViewportConfig, VrtOptions, VrtResult, VrtSummary, generateVrtJsonReport as generateVrtJsonReport$1, generateVrtReport as generateVrtReport$1 };
//# sourceMappingURL=vrt-Vb4aqPZE.d.ts.map