export interface RealtimeEventEnvelope<TEvent extends string = string, TData = unknown> {
  event: TEvent;
  data: TData;
}

export interface RealtimePubSubMessage<TEvent extends string = string, TData = unknown> {
  /**
   * Topic identifies which logical stream this event belongs to.
   * Examples:
   * - orders:sf:801xx0000001234
   * - services:eligibility:001xx000000abcd
   */
  topic: string;
  event: TEvent;
  data: TData;
}

export interface RealtimeStreamOptions {
  /**
   * Event emitted immediately after subscription is established.
   */
  readyEvent?: string | null;
  /**
   * Heartbeat interval (ms). Set to 0 to disable.
   */
  heartbeatMs?: number;
  /**
   * Heartbeat event name.
   */
  heartbeatEvent?: string | null;
}

// Note: NestJS MessageEvent is not a generic type in our setup (verbatimModuleSyntax + current Nest types).
// Keep this file purely as shared shape definitions.
