import { EGuaranteePolicyDepositMode, IAvailabilityGuaranteePolicyDetails, IPromoCodeDetails } from '@roomstay/core';
import dayjs from 'dayjs';
import BaseAPI from './BaseAPI';
import { EngineFilterType } from '../contexts';
import { HotelDTO } from '../models/Api/HotelDTO';
import BasketRow from '../models/BasketRow';
import { Room } from '../models/Room/Room';
interface IPriceByDay {
    [date: string]: number;
}
interface INightStayByDay {
    [date: string]: number;
}
type NullableAvailabilityGuaranteePolicyDetails = Omit<IAvailabilityGuaranteePolicyDetails, 'depositMode'> & {
    depositMode: EGuaranteePolicyDepositMode | null;
};
export interface IAvailabilityByHotelId {
    [hotelId: string]: {
        hotel: HotelDTO;
        rooms: Room[];
    };
}
export default class AvailabilityAPI extends BaseAPI {
    static policyMappings: {
        guarantee: {
            [name: string]: NullableAvailabilityGuaranteePolicyDetails;
        };
        cancel: {
            [name: string]: string;
        };
    };
    static maxNightPrice: number;
    static minNightPrice: number | null;
    private roomTypesData;
    private ratePlansData;
    private cachedMinNightStay;
    private cachedAvailability;
    private cachedAvailabilityByHotelIds;
    private cachedHasMinStayUpsellOpportunities;
    private calendar;
    private arrivalMinNightStay;
    private arrivalMaxNightStay;
    private crossSellHotelInfo;
    private calendarWarnings;
    private availabilityWarnings;
    private rooms;
    private rates;
    private fetchDataPromise;
    private fetchDataPromiseByHotelIds;
    private calendarPromises;
    private cachedMidNightStayPromises;
    private promoCodeDetails;
    private cachedAreaAvailability;
    private areaAvailabilityPromises;
    constructor();
    getCrossSellHotelInfo(hotelId: number | string): any;
    getPromoCodeDetails(promoCode: string): IPromoCodeDetails | null;
    getCheapestPricePerDay: (fromDate: dayjs.Dayjs, toDate: dayjs.Dayjs, adults: number, children: number, infants: number, promoCode: string, roomCode: string, rateCode: string, hotelId: string, memberNumber?: string | number, isCrossSell?: boolean) => Promise<{
        [date: string]: number;
    }>;
    getCheapestPriceForDay: (day: dayjs.Dayjs, adults: number, children: number, infants: number, promoCode: string, roomCode: string, rateCode: string, hotelID: string, memberNumber?: string | number, parseErrors?: boolean) => Promise<{
        price: number;
        perCent: number;
        arrivalMinNightStay: number;
        arrivalMaxNightStay: number;
    } | null>;
    fetchCalendar: (month: dayjs.Dayjs, adults: number, children: number, infants: number, promoCode: string, roomCode: string, rateCode: string, hotelId: string, memberNumber?: number | string, parseErrors?: boolean, isCrossSell?: boolean) => Promise<{
        prices: IPriceByDay;
        arrivalMinNightStay: INightStayByDay;
        arrivalMaxNightStay: INightStayByDay;
    } | null>;
    invalidateAvailability: (basketRow: BasketRow, hotelId: string) => Promise<void>;
    fetchMinNightStayData: (basketRow: BasketRow, hotelID: string, memberNumber?: string) => Promise<any>;
    /**
     * Check if minimum stay upsell opportunities exist.
     */
    hasMinStayUpsellOpportunities(basketRow: BasketRow, hotelId: string, memberNumber?: string): boolean;
    /**
     * Fetches availability data with minimum stay extensions.
     * This is used for finding upsell opportunities that require extending the stay.
     */
    fetchMinimumStayExtensions: (basketRow: BasketRow, hotelId: string, memberNumber?: string) => Promise<Room[] | undefined>;
    /**
     * Fetches availability data.
     *
     * @param basketRow - The basket row containing booking details.
     * @param hotelId - The unique identifier of the hotel.
     * @param memberNumber - (Optional) The membership number of the user.
     * @param ignoreRoomFilter - If true, skips sending the room code filter in the API request. Default: false.
     * @param eager - If true, returns alternative availability if selected dates are unavailable
     * @param findMinStayExtensions - If true, returns availability for extended dates to meet minimum stay requirements. Default: false.
     * @returns The fetched availability data.
     */
    fetchAvailabilityData: (basketRow: BasketRow, hotelId: string, memberNumber?: string, ignoreRoomFilter?: boolean, eager?: boolean, findMinStayExtensions?: boolean) => Promise<Room[] | undefined>;
    /**
     * Fetches availability data for multiple hotels.
     *
     * @param basketRow - The basket row containing booking details.
     * @param hotelIds - The list of hotel identifiers.
     * @param memberNumber - (Optional) The membership number of the user.
     * @param ignoreRoomFilter - If true, skips sending the room code filter in the API request. Default: false.
     * @returns The fetched availability data grouped by hotelId.
     */
    fetchAvailabilityDataByHotelIds: (basketRow: BasketRow, hotelIds: string[], memberNumber?: string, ignoreRoomFilter?: boolean) => Promise<IAvailabilityByHotelId | undefined>;
    private parseRoomsFromAvailability;
    fetchAvailability: ({ fromDate, toDate, adults, children, infants, promoCode, roomCode, promoOnly, hotelId, }: {
        fromDate: dayjs.Dayjs;
        toDate: dayjs.Dayjs;
        adults: number;
        children?: number;
        infants: number;
        promoCode?: string;
        roomCode?: string;
        promoOnly?: boolean;
        hotelId: string;
    }) => Promise<any>;
    /**
     * TODO: This logic is repeated multiple times throughout this file, we should try and refactor parts of this file to use this function.
     */
    private getQueryIDParams;
    fetchAreaAvailability: (basketRow: BasketRow, hotelId: string, auxiliaryFilters?: EngineFilterType) => Promise<{
        [roomCode: string]: number;
    }>;
    private getQueryID;
}
export {};
