/// <reference types="react-scripts" />

interface CapacitorPreferencesPlugin {
  get?: (options: { key: string }) => Promise<{ value?: string | null }>;
  set?: (options: { key: string; value: string }) => Promise<void>;
  remove?: (options: { key: string }) => Promise<void>;
}

interface CapacitorBridge {
  isNativePlatform?: () => boolean;
  isNative?: boolean;
  getPlatform?: () => string;
  Plugins?: {
    Preferences?: CapacitorPreferencesPlugin;
    App?: { addListener?: (...args: unknown[]) => unknown };
    Network?: { addListener?: (...args: unknown[]) => unknown };
  };
}

interface Window {
  Capacitor?: CapacitorBridge;
}
