import type { MessageSearchHit } from '@/entities/message';
import type { EventSearchHit } from '@/entities/event';
import type { ContactSearchHit } from '@/entities/contact';

export type UnifiedSurface = 'contact' | 'message' | 'mail' | 'calendar';

export type UnifiedSearchHit =
  | { surface: 'contact'; hit: ContactSearchHit; score: number }
  | { surface: 'message'; hit: MessageSearchHit; score: number }
  | { surface: 'mail'; hit: MessageSearchHit; score: number }
  | { surface: 'calendar'; hit: EventSearchHit; score: number };

export interface UnifiedSearchResult {
  query: string;
  limit: number;
  results: readonly UnifiedSearchHit[];
}
