import type { EventType } from '../prisma-client';
import dayjs from '../dayjs';
export declare class BookingDateInPastError extends Error {
    constructor(message?: string);
}
/**
 * Dates passed to this function are timezone neutral.
 */
export declare function calculatePeriodLimits({ periodType, periodDays, periodCountCalendarDays, periodStartDate, periodEndDate, 
/**
 * These dates will be considered in the same utfcOffset as provided
 */
allDatesWithBookabilityStatusInBookerTz, eventUtcOffset, bookerUtcOffset, 
/**
 * This is temporary till we find a way to provide allDatesWithBookabilityStatus in handleNewBooking without re-computing availability.
 * It is okay for handleNewBooking to pass it as true as the frontend won't allow selecting a timeslot that is out of bounds of ROLLING_WINDOW
 * But for the booking that happen through API, we absolutely need to check the ROLLING_WINDOW limits.
 */
_skipRollingWindowCheck, }: Pick<EventType, "periodType" | "periodDays" | "periodCountCalendarDays" | "periodStartDate" | "periodEndDate"> & {
    allDatesWithBookabilityStatusInBookerTz: Record<string, {
        isBookable: boolean;
    }> | null;
    eventUtcOffset: number;
    bookerUtcOffset: number;
    _skipRollingWindowCheck?: boolean;
}): PeriodLimits;
export declare function getRollingWindowEndDate({ startDateInBookerTz, daysNeeded, allDatesWithBookabilityStatusInBookerTz, countNonBusinessDays, }: {
    /**
     * It should be provided in the same utcOffset as the dates in `allDatesWithBookabilityStatus`
     * This is because we do a lookup by day in `allDatesWithBookabilityStatus`
     */
    startDateInBookerTz: dayjs.Dayjs;
    daysNeeded: number;
    allDatesWithBookabilityStatusInBookerTz: Record<string, {
        isBookable: boolean;
    }>;
    countNonBusinessDays: boolean | null;
}): dayjs.Dayjs;
/**
 * To be used when we work on Timeslots(and not Dates) to check boundaries
 * It ensures that the time isn't in the past and also checks if the time is within the minimum booking notice.
 * Note: It throws error that needs to be caught by caller.
 */
export declare function isTimeOutOfBounds({ time, minimumBookingNotice, }: {
    time: dayjs.ConfigType;
    minimumBookingNotice?: number;
}): boolean;
/**
 * Wrapper over isTimeOutOfBounds to return a status object.
 * Note: It doesn't throw any error and can be safely used
 */
export declare function getPastTimeAndMinimumBookingNoticeBoundsStatus({ time, minimumBookingNotice, }: {
    time: dayjs.ConfigType;
    minimumBookingNotice?: number;
}): {
    isOutOfBounds: boolean;
    reason: "minBookNoticeViolation" | "slotInPast" | null;
};
type PeriodLimits = {
    endOfRollingPeriodEndDayInBookerTz: dayjs.Dayjs | null;
    startOfRangeStartDayInEventTz: dayjs.Dayjs | null;
    endOfRangeEndDayInEventTz: dayjs.Dayjs | null;
};
export declare function isTimeViolatingFutureLimit({ time, periodLimits, }: {
    time: dayjs.ConfigType;
    periodLimits: PeriodLimits;
}): boolean;
export default function isOutOfBounds(time: dayjs.ConfigType, { periodType, periodDays, periodCountCalendarDays, periodStartDate, periodEndDate, eventUtcOffset, bookerUtcOffset, }: Pick<EventType, "periodType" | "periodDays" | "periodCountCalendarDays" | "periodStartDate" | "periodEndDate"> & {
    eventUtcOffset: number;
    bookerUtcOffset: number;
}, minimumBookingNotice?: number): boolean;
export {};
//# sourceMappingURL=isOutOfBounds.d.ts.map