// Global type declarations for WordPress API configuration

declare global {
  interface Window {
    /** WordPress i18n functions provided by wp-i18n script */
    wp?: {
      i18n?: {
        /** Translate a string */
        __: (text: string, domain?: string) => string;
        /** Translate and echo a string */
        _e: (text: string, domain?: string) => void;
        /** Translate with context */
        _x: (text: string, context: string, domain?: string) => string;
        /** Translate plural forms */
        _n: (single: string, plural: string, number: number, domain?: string) => string;
        /** Translate plural forms with context */
        _nx: (
          single: string,
          plural: string,
          number: number,
          context: string,
          domain?: string,
        ) => string;
        /** sprintf-style string formatting */
        sprintf: (format: string, ...args: unknown[]) => string;
        /** Check if current locale is RTL */
        isRTL: () => boolean;
        /** Set locale data for a domain */
        setLocaleData: (data: Record<string, unknown>, domain?: string) => void;
      };
    };
    sequensyAPI: {
      root: string;
      nonce: string;
      activeScreen?: string;
      is_pro?: boolean;
      capabilities?: {
        multi_account?: boolean;
        version_history?: boolean;
        nested_filters?: boolean;
        marketplace_can_install?: boolean;
        activity_log_limit?: number;
        filter_operators?: {
          /** Operator key => human-readable label */
          operators: Record<string, string>;
          /** Field type => array of valid operator keys */
          operators_by_type: Record<string, string[]>;
          /** Operators that require a value input */
          operators_requiring_value: string[];
        };
      };
      plugin_name?: string;
      /** Pro REST API root URL (set by Pro plugin) */
      proRoot?: string;
      /** Pro extends these fields when active */
      license?: {
        is_active: boolean;
        tier: string | null;
      };
      packages?: {
        updates_available: number;
      };
    };
  }
}

export {}; // Make this a module for global augmentation
