/// <reference types="vite/client" />

interface LicenseData {
  isPro: boolean;
  plan: "free" | "trial" | "pro";
  upgradeUrl: string;
}

/**
 * Location definition from PHP Locations class.
 */
interface PboLocationDefinition {
  key: string;
  label: string;
  description: string;
}

/**
 * Font option structure.
 */
interface PboFontOption {
  value: string;
  label: string;
}

/**
 * Fonts data structure organized by groups.
 */
interface PboFontsConfig {
  standard: PboFontOption[];
  google: PboFontOption[];
  custom: PboFontOption[];
}

interface OppbAdminConfig {
  apiUrl: string;
  nonce: string;
  adminUrl: string;
  pluginUrl: string;
  version: string;
  license?: LicenseData;
  currency: {
    symbol: string;
    code: string;
    position: "left" | "right" | "left_space" | "right_space";
    decimals: number;
    decimal_separator: string;
    thousand_separator: string;
  };
  /**
   * Available locations from the centralized Locations class.
   * By default: single_product, loop.
   * Extensible via 'oppb_available_locations' filter.
   */
  locations: PboLocationDefinition[];
  /**
   * Font families organized by groups.
   * - standard: System fonts (Arial, Helvetica, etc.)
   * - google: Google Fonts (loaded dynamically)
   * - custom: Custom fonts added via 'oppb_custom_fonts' filter
   */
  fonts: PboFontsConfig;
  /**
   * Default render mode configured via 'oppb_render_mode' filter.
   * - 'ssr': Server-Side Rendering (default) - best performance and SEO
   * - 'web_component': Client-side rendering via custom element
   */
  render_mode: "ssr" | "web_component";
  i18n: {
    save: string;
    export: string;
    preview: string;
    settings: string;
    delete: string;
    cancel: string;
  };
}

declare global {
  interface Window {
    oppbAdmin: OppbAdminConfig;
  }
}

export {};
