import { z } from "zod";
export interface Logger {
    error(msg: string, fields?: Record<string, unknown>): void;
    warn(msg: string, fields?: Record<string, unknown>): void;
}
export declare const FlightEventTypeSchema: z.ZodEnum<{
    DEPARTURE: "DEPARTURE";
    ARRIVAL: "ARRIVAL";
    DELAY: "DELAY";
    CANCEL: "CANCEL";
    DIVERT: "DIVERT";
    GATE_CHANGE: "GATE_CHANGE";
    BOARDING: "BOARDING";
    CREW_UPDATE: "CREW_UPDATE";
    WEATHER_ADVISORY: "WEATHER_ADVISORY";
    ATC_DELAY: "ATC_DELAY";
    EQUIPMENT_CHANGE: "EQUIPMENT_CHANGE";
}>;
export type FlightEventType = z.infer<typeof FlightEventTypeSchema>;
export declare const FlightEventSchema: z.ZodObject<{
    eventId: z.ZodString;
    flightNumber: z.ZodString;
    airline: z.ZodString;
    origin: z.ZodString;
    destination: z.ZodString;
    type: z.ZodEnum<{
        DEPARTURE: "DEPARTURE";
        ARRIVAL: "ARRIVAL";
        DELAY: "DELAY";
        CANCEL: "CANCEL";
        DIVERT: "DIVERT";
        GATE_CHANGE: "GATE_CHANGE";
        BOARDING: "BOARDING";
        CREW_UPDATE: "CREW_UPDATE";
        WEATHER_ADVISORY: "WEATHER_ADVISORY";
        ATC_DELAY: "ATC_DELAY";
        EQUIPMENT_CHANGE: "EQUIPMENT_CHANGE";
    }>;
    timestamp: z.ZodString;
    data: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    source: z.ZodString;
    processed: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>;
export type FlightEvent = z.infer<typeof FlightEventSchema>;
export declare const TransportTypeSchema: z.ZodEnum<{
    websocket: "websocket";
    polling: "polling";
}>;
export type TransportType = z.infer<typeof TransportTypeSchema>;
export declare const EventSubscriptionSchema: z.ZodObject<{
    subscriptionId: z.ZodString;
    transport: z.ZodEnum<{
        websocket: "websocket";
        polling: "polling";
    }>;
    flightNumbers: z.ZodDefault<z.ZodArray<z.ZodString>>;
    airlines: z.ZodDefault<z.ZodArray<z.ZodString>>;
    eventTypes: z.ZodDefault<z.ZodArray<z.ZodEnum<{
        DEPARTURE: "DEPARTURE";
        ARRIVAL: "ARRIVAL";
        DELAY: "DELAY";
        CANCEL: "CANCEL";
        DIVERT: "DIVERT";
        GATE_CHANGE: "GATE_CHANGE";
        BOARDING: "BOARDING";
        CREW_UPDATE: "CREW_UPDATE";
        WEATHER_ADVISORY: "WEATHER_ADVISORY";
        ATC_DELAY: "ATC_DELAY";
        EQUIPMENT_CHANGE: "EQUIPMENT_CHANGE";
    }>>>;
    airports: z.ZodDefault<z.ZodArray<z.ZodString>>;
    createdAt: z.ZodString;
}, z.core.$strip>;
export type EventSubscription = z.infer<typeof EventSubscriptionSchema>;
export declare const WatcherConfigSchema: z.ZodObject<{
    pollIntervalMs: z.ZodNumber;
    bufferMaxSize: z.ZodNumber;
    retentionMs: z.ZodNumber;
}, z.core.$strip>;
export type WatcherConfig = z.infer<typeof WatcherConfigSchema>;
export type EventHandler = (event: FlightEvent) => void;
/**
 * Watches flight status events via dual transport (WebSocket or polling).
 * Maintains an in-memory event buffer and supports subscriptions with
 * fine-grained filters.
 */
export declare class FlightStatusWatcher {
    private readonly config;
    private readonly events;
    private readonly subscriptions;
    private readonly handlers;
    private cleanupTimer?;
    logger?: Logger;
    constructor(config?: Partial<WatcherConfig>, logger?: Logger);
    /** Start the watcher with periodic cleanup. */
    start(): void;
    /** Stop the watcher. */
    stop(): void;
    /** Ingest an event. Validates with Zod at the boundary. */
    ingest(event: FlightEvent): void;
    /** Subscribe to filtered events. */
    subscribe(subscription: Omit<EventSubscription, "subscriptionId" | "createdAt">, handler: EventHandler): string;
    /** Unsubscribe. */
    unsubscribe(subscriptionId: string): void;
    /** Query buffered events. */
    query(filter: Partial<Pick<EventSubscription, "flightNumbers" | "airlines" | "eventTypes" | "airports">>): FlightEvent[];
    /** Get all events for a specific flight. */
    getFlightHistory(flightNumber: string): FlightEvent[];
    /** Get current buffer size. */
    bufferSize(): number;
    /** Get active subscription count. */
    subscriptionCount(): number;
    private notifySubscriptions;
    private matchesSubscription;
    private evictExpired;
}
//# sourceMappingURL=events.d.ts.map