import type { DAVObject } from "tsdav";
import type { Calendar, CalendarEvent, EventBusyDate, IntegrationCalendar, NewCalendarEventType } from "@calcom/types/Calendar";
import type { CredentialPayload } from "@calcom/types/Credential";
type FetchObjectsWithOptionalExpandOptionsType = {
    selectedCalendars: IntegrationCalendar[];
    startISOString: string;
    dateTo: string;
    headers?: Record<string, string>;
};
export default abstract class BaseCalendarService implements Calendar {
    private url;
    private credentials;
    private headers;
    protected integrationName: string;
    private log;
    private credential;
    constructor(credential: CredentialPayload, integrationName: string, url?: string);
    private getAttendees;
    createEvent(event: CalendarEvent, credentialId: number): Promise<NewCalendarEventType>;
    updateEvent(uid: string, event: CalendarEvent): Promise<NewCalendarEventType | NewCalendarEventType[]>;
    deleteEvent(uid: string): Promise<void>;
    /**
     * getUserTimezoneFromDB() retrieves the timezone of a user from the database.
     *
     * @param {number} id - The user's unique identifier.
     * @returns {Promise<string | undefined>} - A Promise that resolves to the user's timezone or "Europe/London" as a default value if the timezone is not found.
     */
    getUserTimezoneFromDB: (id: number) => Promise<string | undefined>;
    /**
     * getUserId() extracts the user ID from the first calendar in an array of IntegrationCalendars.
     *
     * @param {IntegrationCalendar[]} selectedCalendars - An array of IntegrationCalendars.
     * @returns {number | null} - The user ID associated with the first calendar in the array, or null if the array is empty or the user ID is not found.
     */
    getUserId: (selectedCalendars: IntegrationCalendar[]) => number | null;
    isValidFormat: (url: string) => boolean;
    getAvailability(dateFrom: string, dateTo: string, selectedCalendars: IntegrationCalendar[]): Promise<EventBusyDate[]>;
    listCalendars(event?: CalendarEvent): Promise<IntegrationCalendar[]>;
    /**
     * The fetchObjectsWithOptionalExpand function is responsible for fetching calendar objects
     * from an array of selectedCalendars. It attempts to fetch objects with the expand option
     * alone such that it works if a calendar supports it. If any calendar object has an undefined 'data' property
     * and etag isn't undefined, the function makes a new request without the expand option to retrieve the data.
     * The result is a flattened array of calendar objects with the structure { url: ..., etag: ..., data: ...}.
     *
     * @param {Object} options - The options object containing the following properties:
     *   @param {IntegrationCalendar[]} options.selectedCalendars - An array of IntegrationCalendar objects to fetch data from.
     *   @param {string} options.startISOString - The start date of the date range to fetch events from, in ISO 8601 format.
     *   @param {string} options.dateTo - The end date of the date range to fetch events from.
     *   @param {Object} options.headers - Headers to be included in the API requests.
     * @returns {Promise<Array>} - A promise that resolves to a flattened array of calendar objects with the structure { url: ..., etag: ..., data: ...}.
     */
    fetchObjectsWithOptionalExpand({ selectedCalendars, startISOString, dateTo, headers, }: FetchObjectsWithOptionalExpandOptionsType): Promise<DAVObject[]>;
    private getEvents;
    private getEventsByUID;
    private getAccount;
}
export {};
//# sourceMappingURL=CalendarService.d.ts.map