import type { CalendarEvent, EventBusyDate, IntegrationCalendar, NewCalendarEventType, SelectedCalendar } from "@calcom/types/Calendar";
import type { CredentialForCalendarService, CredentialPayload } from "@calcom/types/Credential";
import type { EventResult } from "@calcom/types/EventManager";
export declare const getCalendarCredentials: (credentials: Array<CredentialForCalendarService>) => {
    integration: import("@calcom/types/App").App & {
        credential: import('../app-store/utils').CredentialDataWithTeamName;
        credentials: import('../app-store/utils').CredentialDataWithTeamName[];
        locationOption: import('../app-store/utils').LocationOption | null;
    };
    credential: import('../app-store/utils').CredentialDataWithTeamName;
    calendar: Promise<import("@calcom/types/Calendar").Calendar | null>;
}[];
export declare const getCalendarCredentialsWithoutDelegation: (credentials: CredentialPayload[]) => {
    integration: import("@calcom/types/App").App & {
        credential: import('../app-store/utils').CredentialDataWithTeamName;
        credentials: import('../app-store/utils').CredentialDataWithTeamName[];
        locationOption: import('../app-store/utils').LocationOption | null;
    };
    credential: import('../app-store/utils').CredentialDataWithTeamName;
    calendar: Promise<import("@calcom/types/Calendar").Calendar | null>;
}[];
export declare const getConnectedCalendars: (calendarCredentials: ReturnType<typeof getCalendarCredentials>, selectedCalendars: {
    externalId: string;
}[], destinationCalendarExternalId?: string) => Promise<{
    connectedCalendars: ({
        integration: {
            installed?: boolean;
            type: `${string}_calendar` | `${string}_messaging` | `${string}_payment` | `${string}_video` | `${string}_other` | `${string}_automation` | `${string}_analytics` | `${string}_crm` | `${string}_other_calendar`;
            title?: string;
            name: string;
            description: string;
            variant: "calendar" | "payment" | "conferencing" | "video" | "other" | "other_calendar" | "automation" | "crm";
            slug: string;
            category?: string;
            categories: import('../prisma-client').AppCategories[];
            extendsFeature?: "EventType" | "User";
            logo: string;
            publisher: string;
            url: string;
            docsUrl?: string;
            verified?: boolean;
            trending?: boolean;
            rating?: number;
            reviews?: number;
            isGlobal?: boolean;
            simplePath?: string;
            email: string;
            key?: import('../prisma-client').Prisma.JsonValue;
            feeType?: "monthly" | "usage-based" | "one-time" | "free";
            price?: number;
            commission?: number;
            licenseRequired?: boolean;
            teamsPlanRequired?: {
                upgradeUrl: string;
            };
            appData?: import("@calcom/types/App").AppData;
            paid?: import("@calcom/types/App").PaidAppData;
            dirName?: string;
            isTemplate?: boolean;
            __template?: string;
            dependencies?: string[];
            concurrentMeetings?: boolean;
            createdAt?: string;
            isOAuth?: boolean;
            delegationCredential?: {
                workspacePlatformSlug: string;
            };
            locationOption: import('../app-store/utils').LocationOption | null;
        };
        credentialId: number;
        delegationCredentialId: string | null;
        error?: undefined;
        primary?: undefined;
        calendars?: undefined;
    } | {
        integration: {
            installed?: boolean;
            type: `${string}_calendar` | `${string}_messaging` | `${string}_payment` | `${string}_video` | `${string}_other` | `${string}_automation` | `${string}_analytics` | `${string}_crm` | `${string}_other_calendar`;
            title?: string;
            name: string;
            description: string;
            variant: "calendar" | "payment" | "conferencing" | "video" | "other" | "other_calendar" | "automation" | "crm";
            slug: string;
            category?: string;
            categories: import('../prisma-client').AppCategories[];
            extendsFeature?: "EventType" | "User";
            logo: string;
            publisher: string;
            url: string;
            docsUrl?: string;
            verified?: boolean;
            trending?: boolean;
            rating?: number;
            reviews?: number;
            isGlobal?: boolean;
            simplePath?: string;
            email: string;
            key?: import('../prisma-client').Prisma.JsonValue;
            feeType?: "monthly" | "usage-based" | "one-time" | "free";
            price?: number;
            commission?: number;
            licenseRequired?: boolean;
            teamsPlanRequired?: {
                upgradeUrl: string;
            };
            appData?: import("@calcom/types/App").AppData;
            paid?: import("@calcom/types/App").PaidAppData;
            dirName?: string;
            isTemplate?: boolean;
            __template?: string;
            dependencies?: string[];
            concurrentMeetings?: boolean;
            createdAt?: string;
            isOAuth?: boolean;
            delegationCredential?: {
                workspacePlatformSlug: string;
            };
            locationOption: import('../app-store/utils').LocationOption | null;
        };
        credentialId: number;
        error: {
            message: string;
        };
        delegationCredentialId?: undefined;
        primary?: undefined;
        calendars?: undefined;
    } | {
        integration: {
            installed?: boolean;
            type: `${string}_calendar` | `${string}_messaging` | `${string}_payment` | `${string}_video` | `${string}_other` | `${string}_automation` | `${string}_analytics` | `${string}_crm` | `${string}_other_calendar`;
            title?: string;
            name: string;
            description: string;
            variant: "calendar" | "payment" | "conferencing" | "video" | "other" | "other_calendar" | "automation" | "crm";
            slug: string;
            category?: string;
            categories: import('../prisma-client').AppCategories[];
            extendsFeature?: "EventType" | "User";
            logo: string;
            publisher: string;
            url: string;
            docsUrl?: string;
            verified?: boolean;
            trending?: boolean;
            rating?: number;
            reviews?: number;
            isGlobal?: boolean;
            simplePath?: string;
            email: string;
            key?: import('../prisma-client').Prisma.JsonValue;
            feeType?: "monthly" | "usage-based" | "one-time" | "free";
            price?: number;
            commission?: number;
            licenseRequired?: boolean;
            teamsPlanRequired?: {
                upgradeUrl: string;
            };
            appData?: import("@calcom/types/App").AppData;
            paid?: import("@calcom/types/App").PaidAppData;
            dirName?: string;
            isTemplate?: boolean;
            __template?: string;
            dependencies?: string[];
            concurrentMeetings?: boolean;
            createdAt?: string;
            isOAuth?: boolean;
            delegationCredential?: {
                workspacePlatformSlug: string;
            };
            locationOption: import('../app-store/utils').LocationOption | null;
        };
        credentialId: number;
        delegationCredentialId: string | null;
        primary: {
            readOnly: boolean;
            primary: true | null;
            isSelected: boolean;
            credentialId: number;
            delegationCredentialId: string | null;
            name?: string;
            email?: string;
            primaryEmail?: string;
            integrationTitle?: string;
            error?: string | null | undefined;
            id?: string | undefined;
            userId?: number | undefined;
            eventTypeId?: number | null | undefined;
            integration?: string | undefined;
            domainWideDelegationCredentialId?: string | null | undefined;
            googleChannelId?: string | null | undefined;
            googleChannelKind?: string | null | undefined;
            googleChannelResourceId?: string | null | undefined;
            googleChannelResourceUri?: string | null | undefined;
            googleChannelExpiration?: string | null | undefined;
            lastErrorAt?: Date | null | undefined;
            watchAttempts?: number | undefined;
            unwatchAttempts?: number | undefined;
            maxAttempts?: number | undefined;
            externalId: string;
        };
        calendars: {
            readOnly: boolean;
            primary: true | null;
            isSelected: boolean;
            credentialId: number;
            delegationCredentialId: string | null;
            name?: string;
            email?: string;
            primaryEmail?: string;
            integrationTitle?: string;
            error?: string | null | undefined;
            id?: string | undefined;
            userId?: number | undefined;
            eventTypeId?: number | null | undefined;
            integration?: string | undefined;
            domainWideDelegationCredentialId?: string | null | undefined;
            googleChannelId?: string | null | undefined;
            googleChannelKind?: string | null | undefined;
            googleChannelResourceId?: string | null | undefined;
            googleChannelResourceUri?: string | null | undefined;
            googleChannelExpiration?: string | null | undefined;
            lastErrorAt?: Date | null | undefined;
            watchAttempts?: number | undefined;
            unwatchAttempts?: number | undefined;
            maxAttempts?: number | undefined;
            externalId: string;
        }[];
        error?: undefined;
    } | {
        integration: {
            installed?: boolean;
            type: `${string}_calendar` | `${string}_messaging` | `${string}_payment` | `${string}_video` | `${string}_other` | `${string}_automation` | `${string}_analytics` | `${string}_crm` | `${string}_other_calendar`;
            title?: string;
            name: string;
            description: string;
            variant: "calendar" | "payment" | "conferencing" | "video" | "other" | "other_calendar" | "automation" | "crm";
            slug: string;
            category?: string;
            categories: import('../prisma-client').AppCategories[];
            extendsFeature?: "EventType" | "User";
            logo: string;
            publisher: string;
            url: string;
            docsUrl?: string;
            verified?: boolean;
            trending?: boolean;
            rating?: number;
            reviews?: number;
            isGlobal?: boolean;
            simplePath?: string;
            email: string;
            key?: import('../prisma-client').Prisma.JsonValue;
            feeType?: "monthly" | "usage-based" | "one-time" | "free";
            price?: number;
            commission?: number;
            licenseRequired?: boolean;
            teamsPlanRequired?: {
                upgradeUrl: string;
            };
            appData?: import("@calcom/types/App").AppData;
            paid?: import("@calcom/types/App").PaidAppData;
            dirName?: string;
            isTemplate?: boolean;
            __template?: string;
            dependencies?: string[];
            concurrentMeetings?: boolean;
            createdAt?: string;
            isOAuth?: boolean;
            delegationCredential?: {
                workspacePlatformSlug: string;
            };
            locationOption: import('../app-store/utils').LocationOption | null;
        };
        credentialId: number;
        delegationCredentialId: string | null | undefined;
        error: {
            message: string;
        };
        primary?: undefined;
        calendars?: undefined;
    })[];
    destinationCalendar: IntegrationCalendar | undefined;
}>;
/**
 * This function deduplicates credentials based on selected calendars
 * It removes regular credentials for which corresponding delegation credentials exist which can be identified only associating them with selected calendars
 *
 * This is important to prevent unnecessary/duplicate calls to calendar APIs
 */
export declare const deduplicateCredentialsBasedOnSelectedCalendars: ({ credentials, selectedCalendars, }: {
    credentials: CredentialForCalendarService[];
    selectedCalendars: SelectedCalendar[];
}) => CredentialForCalendarService[];
export declare const getBusyCalendarTimes: (
/**
 * withCredentials can possibly have duplicate credential in case DelegationCredential is enabled.
 * There is no way to deduplicate that at the moment because a `credential` doesn't directly know to which external_id(or email it is connected to).
 * So, there could be multiple credentials for the same user.
 * 1. Delegated Credential - that fetches events for john@acme.com
 * 2. Regular Credential - that fetches events for john@personal.com
 *
 */
withCredentials: CredentialForCalendarService[], dateFrom: string, dateTo: string, selectedCalendars: SelectedCalendar[], shouldServeCache?: boolean, includeTimeZone?: boolean) => Promise<(EventBusyDate & {
    timeZone?: string;
})[]>;
export declare const createEvent: (credential: CredentialForCalendarService, originalEvent: CalendarEvent, externalId?: string) => Promise<EventResult<NewCalendarEventType>>;
export declare const updateEvent: (credential: CredentialForCalendarService, rawCalEvent: CalendarEvent, bookingRefUid: string | null, externalCalendarId: string | null) => Promise<EventResult<NewCalendarEventType>>;
export declare const deleteEvent: ({ credential, bookingRefUid, event, externalCalendarId, }: {
    credential: CredentialForCalendarService;
    bookingRefUid: string;
    event: CalendarEvent;
    externalCalendarId?: string | null;
}) => Promise<unknown>;
//# sourceMappingURL=CalendarManager.d.ts.map