import type { Prisma, User } from '../../prisma-client';
import type { Booking } from '../../prisma/client';
import type { SelectedCalendar } from '../../prisma/client';
import { RRResetInterval } from '../../prisma/enums';
import type { CredentialForCalendarService } from "@calcom/types/Credential";
type PartialBooking = Pick<Booking, "id" | "createdAt" | "userId" | "status"> & {
    attendees: {
        email: string | null;
    }[];
};
type PartialUser = Pick<User, "id" | "email">;
export type RoutingFormResponse = {
    response: Prisma.JsonValue;
    chosenRouteId: string | null;
    form: {
        fields: Prisma.JsonValue;
        routes: Prisma.JsonValue;
    };
};
type VirtualQueuesDataType = {
    chosenRouteId: string;
    fieldOptionData: {
        fieldId: string;
        selectedOptionIds: string | number | string[];
    };
};
interface GetLuckyUserParams<T extends PartialUser> {
    availableUsers: [T, ...T[]];
    eventType: {
        id: number;
        isRRWeightsEnabled: boolean;
        team: {
            parentId?: number | null;
            rrResetInterval: RRResetInterval | null;
        } | null;
    };
    allRRHosts: {
        user: {
            id: number;
            email: string;
            credentials: CredentialForCalendarService[];
            userLevelSelectedCalendars: SelectedCalendar[];
        };
        createdAt: Date;
        weight?: number | null;
    }[];
    routingFormResponse: RoutingFormResponse | null;
}
type OOODataType = {
    userId: number;
    oooEntries: {
        start: Date;
        end: Date;
    }[];
}[];
export declare function getLuckyUser<T extends PartialUser & {
    priority?: number | null;
    weight?: number | null;
}>(getLuckyUserParams: GetLuckyUserParams<T>): Promise<T>;
type FetchedData = {
    bookingsOfNotAvailableUsersOfInterval: PartialBooking[];
    bookingsOfAvailableUsersOfInterval: PartialBooking[];
    allRRHostsBookingsOfInterval: PartialBooking[];
    allRRHostsCreatedInInterval: {
        userId: number;
        createdAt: Date;
    }[];
    organizersWithLastCreated: {
        id: number;
        bookings: {
            createdAt: Date;
        }[];
    }[];
    attributeWeights?: {
        userId: number;
        weight: number;
    }[] | null;
    virtualQueuesData?: VirtualQueuesDataType | null;
    oooData: OOODataType;
};
export declare function getLuckyUser_requiresDataToBePreFetched<T extends PartialUser & {
    priority?: number | null;
    weight?: number | null;
}>({ availableUsers, ...getLuckyUserParams }: GetLuckyUserParams<T> & FetchedData): {
    luckyUser: T;
    usersAndTheirBookingShortfalls: {
        id: number;
        bookingShortfall: number;
        calibration: number;
        weight: number;
    }[];
};
type AvailableUserBase = PartialUser & {
    priority: number | null;
    weight: number | null;
};
export declare function getOrderedListOfLuckyUsers<AvailableUser extends AvailableUserBase>(getLuckyUserParams: GetLuckyUserParams<AvailableUser>): Promise<{
    users: AvailableUser[];
    isUsingAttributeWeights: boolean;
    perUserData: {
        bookingsCount: Record<number, number>;
        bookingShortfalls: Record<number, number> | null;
        calibrations: Record<number, number> | null;
        weights: Record<number, number> | null;
    };
}>;
export declare function prepareQueuesAndAttributesData<T extends PartialUser>({ eventType, routingFormResponse, allRRHosts, }: Omit<GetLuckyUserParams<T>, "availableUsers">): Promise<{
    attributeWeights: {
        userId: number;
        weight: number;
    }[] | undefined;
    virtualQueuesData: {
        chosenRouteId: string;
        fieldOptionData: {
            fieldId: string;
            selectedOptionIds: string | number | string[];
        };
    } | undefined;
}>;
export {};
//# sourceMappingURL=getLuckyUser.d.ts.map