import { z } from "zod";
import type { FlightEvent } from "./events.ts";
export interface Logger {
    error(msg: string, fields?: Record<string, unknown>): void;
    warn(msg: string, fields?: Record<string, unknown>): void;
}
export declare const DelayRecordSchema: z.ZodObject<{
    flightNumber: z.ZodString;
    airline: z.ZodString;
    origin: z.ZodString;
    destination: z.ZodString;
    delayMinutes: z.ZodNumber;
    cause: z.ZodEnum<{
        unknown: "unknown";
        crew: "crew";
        weather: "weather";
        mechanical: "mechanical";
        atc: "atc";
        "late-aircraft": "late-aircraft";
    }>;
    propagated: z.ZodDefault<z.ZodBoolean>;
    knockOnDelay: z.ZodDefault<z.ZodNumber>;
    timestamp: z.ZodString;
}, z.core.$strip>;
export type DelayRecord = z.infer<typeof DelayRecordSchema>;
export declare const DelayPropagatorConfigSchema: z.ZodObject<{
    minTurnaroundMinutes: z.ZodNumber;
    decayFactor: z.ZodNumber;
    maxDepth: z.ZodNumber;
    distanceAware: z.ZodDefault<z.ZodBoolean>;
}, z.core.$strip>;
export type DelayPropagatorConfig = z.infer<typeof DelayPropagatorConfigSchema>;
/**
 * Models delay propagation across connecting flight legs.
 * A delay on an inbound aircraft cascades to subsequent departures,
 * decaying by a factor per leg until the delay falls below the
 * minimum turnaround buffer.
 */
export declare class DelayPropagator {
    private readonly config;
    private readonly delays;
    /** Injected distance lookup for distance-aware propagation. */
    private distanceFn;
    logger?: Logger;
    constructor(config?: Partial<DelayPropagatorConfig>, logger?: Logger);
    /**
     * Inject a distance lookup function for distance-aware propagation.
     * The function should return great-circle distance in km.
     * Typical usage: `(o, d) => airportDistance(o, d) ?? 0`
     */
    setDistanceLookup(fn: (origin: string, destination: string) => Promise<number>): void;
    /**
     * Scale minTurnaroundMinutes by distance band.
     * Short-haul needs less turnaround; long-haul needs more.
     */
    private scaleTurnaround;
    /** Record a delay event. Validates input with Zod. */
    recordDelay(delay: Omit<DelayRecord, "propagated" | "knockOnDelay">): DelayRecord;
    /**
     * Compute the knock-on delay for a downstream flight.
     * If an inbound aircraft is delayed, the next departure from the
     * same airport may be delayed by (inbound delay - turnaround buffer),
     * decayed by the propagation factor for each subsequent leg.
     */
    propagateDelay(inboundFlight: string, outboundOrigin: string, depth?: number): number;
    /**
     * Async variant of propagateDelay that factors in route distance.
     * When distanceAware is enabled and a distance lookup is set,
     * the turnaround time is scaled by distance band:
     *   < 500 km:  ×0.7 (short-haul, quick turnaround)
     *   500–3000:  ×1.0 (medium-haul, standard)
     *   3000–6000: ×1.5 (long-haul)
     *   > 6000:    ×2.0 (ultra-long-haul)
     *
     * Falls back to sync propagateDelay when distanceAware is false.
     */
    propagateDelayAsync(inboundFlight: string, outboundOrigin: string, depth?: number): Promise<number>;
    /**
     * Get all flights affected by a delay chain starting from a root delay.
     * Returns an ordered list of { flight, knockOnMinutes }.
     */
    getDelayChain(origin: string, _airline: string): Array<{
        origin: string;
        knockOnMinutes: number;
    }>;
    /** Record a delay from a FlightEvent. Validates input with Zod. */
    recordFromEvent(event: FlightEvent): DelayRecord | null;
    /** Get all recorded delays for an airport. */
    getDelaysAtAirport(airport: string): DelayRecord[];
    /** Clear all delay records. */
    clear(): void;
}
//# sourceMappingURL=delay.d.ts.map