/**
 * Consent SDK Types — Event system
 */

import type { ConsentState } from './core';

// =============================================================================
// Events
// =============================================================================

/**
 * Event-Typen
 */
export type ConsentEventType =
  | 'init'
  | 'change'
  | 'accept_all'
  | 'reject_all'
  | 'save_selection'
  | 'banner_show'
  | 'banner_hide'
  | 'settings_open'
  | 'settings_close'
  | 'vendor_enable'
  | 'vendor_disable'
  | 'error';

/**
 * Event-Listener Callback
 */
export type ConsentEventCallback<T = unknown> = (data: T) => void;

/**
 * Event-Daten fuer verschiedene Events
 */
export type ConsentEventData = {
  init: ConsentState | null;
  change: ConsentState;
  accept_all: ConsentState;
  reject_all: ConsentState;
  save_selection: ConsentState;
  banner_show: undefined;
  banner_hide: undefined;
  settings_open: undefined;
  settings_close: undefined;
  vendor_enable: string;
  vendor_disable: string;
  error: Error;
};
