/**
 * Google Calendar / Tasks / People (Contacts) two-way sync helpers.
 *
 * Used by MailxService to push local edits to Google and pull server
 * changes into the local cache. All functions take a `getToken` function
 * and a fetch implementation so they stay platform-agnostic (Node uses
 * global `fetch` on Node 18+; browsers use window.fetch).
 *
 * Error handling: throws on network / HTTP errors. Caller catches and
 * either retries via the store_sync drainer or surfaces to the UI.
 */
type TokenProvider = () => Promise<string>;
export declare class GoogleHttpError extends Error {
    status: number;
    statusText: string;
    body: string;
    constructor(status: number, statusText: string, body: string);
}
export interface GCalEvent {
    id: string;
    summary: string;
    start: {
        dateTime?: string;
        date?: string;
    };
    end: {
        dateTime?: string;
        date?: string;
    };
    location?: string;
    description?: string;
    etag?: string;
    /** Set on instances expanded from a recurring series (singleEvents=true).
     *  Absent for singletons. Lets the UI filter out recurring expansions. */
    recurringEventId?: string;
    /** Link to open the event in Google Calendar web. */
    htmlLink?: string;
    /** Per-event reminder configuration. `useDefault: true` means apply
     *  the calendar's `defaultReminders` (carried separately on the
     *  calendarList entry); when false, `overrides` lists each popup /
     *  email reminder offset for this specific event. */
    reminders?: {
        useDefault?: boolean;
        overrides?: Array<{
            method: string;
            minutes: number;
        }>;
    };
}
export declare function listCalendarEvents(tokenProvider: TokenProvider, fromMs: number, toMs: number, calendarId?: string): Promise<GCalEvent[]>;
/** Enumerate the user's Google Calendars (everything in their
 *  `calendarList` — owned, shared, subscribed). Used so refreshCalendarEvents
 *  doesn't hard-code `primary` and miss events on secondary calendars
 *  (Bob 2026-05-12: recurring Statin event showed in Thunderbird but not
 *  rmfmail because it's on a secondary calendar, not primary).
 *
 *  Returns each entry's id (use as `calendarId` in subsequent fetches),
 *  summary (display name), and `selected` flag (matches the "show in
 *  Google web UI" toggle — a sensible default filter for "which calendars
 *  should mailx show"). Hidden / explicitly-unselected calendars are
 *  filtered out by the caller; we still return them so a future UI can
 *  expose the full list. */
export interface GCalendarListEntry {
    id: string;
    summary: string;
    selected: boolean;
    primary: boolean;
    /** Hex color Google assigns the calendar (`backgroundColor`). Used to
     *  tint the per-calendar icon/monogram badge in the sidebar. */
    backgroundColor: string;
    /** Calendar-wide default reminder offsets, applied to events whose
     *  `reminders.useDefault === true`. Each entry is `{ method, minutes }`;
     *  client carries only the minutes for popup reminders. */
    defaultReminderMinutes: number[];
}
export declare function listCalendars(tokenProvider: TokenProvider): Promise<GCalendarListEntry[]>;
export declare function createCalendarEvent(tokenProvider: TokenProvider, event: any, calendarId?: string): Promise<GCalEvent>;
export declare function updateCalendarEvent(tokenProvider: TokenProvider, eventId: string, event: any, calendarId?: string): Promise<GCalEvent>;
export declare function deleteCalendarEvent(tokenProvider: TokenProvider, eventId: string, calendarId?: string): Promise<void>;
export interface GTask {
    id: string;
    title: string;
    notes?: string;
    due?: string;
    completed?: string;
    status?: "needsAction" | "completed";
    etag?: string;
}
/** Enumerate all of the user's Google task lists. Mirrors `listCalendars`
 *  — Google "Reminders" are stored as TASKS as of late 2023, and a user
 *  can have many task lists, each potentially holding reminders. Without
 *  this enumeration mailx only ever sees the `@default` list and misses
 *  every reminder filed elsewhere. Bob 2026-05-12. */
export interface GTaskListEntry {
    id: string;
    title: string;
}
export declare function listTaskLists(tokenProvider: TokenProvider): Promise<GTaskListEntry[]>;
export declare function listTasks(tokenProvider: TokenProvider, listId?: string, showCompleted?: boolean): Promise<GTask[]>;
export declare function createTask(tokenProvider: TokenProvider, task: any, listId?: string): Promise<GTask>;
export declare function updateTask(tokenProvider: TokenProvider, taskId: string, task: any, listId?: string): Promise<GTask>;
export declare function deleteTask(tokenProvider: TokenProvider, taskId: string, listId?: string): Promise<void>;
export declare function createContact(tokenProvider: TokenProvider, person: any): Promise<any>;
export declare function updateContact(tokenProvider: TokenProvider, resourceName: string, updatePersonFields: string, person: any): Promise<any>;
export declare function deleteContact(tokenProvider: TokenProvider, resourceName: string): Promise<void>;
export declare function calendarEventToLocal(ev: GCalEvent, accountId: string, calendarDefaultReminderMinutes?: number[]): {
    providerId: string;
    accountId: string;
    title: string;
    startMs: number;
    endMs: number;
    allDay: boolean;
    location: string;
    notes: string;
    etag: string;
    recurringEventId: string | undefined;
    htmlLink: string | undefined;
    reminderMinutes: number[];
};
export declare function localToCalendarEvent(local: {
    title: string;
    startMs: number;
    endMs: number;
    allDay?: boolean;
    location?: string;
    notes?: string;
}): any;
export declare function taskToLocal(t: GTask, accountId: string): {
    providerId: string;
    accountId: string;
    title: string;
    notes: string;
    dueMs: number | undefined;
    completedMs: number | undefined;
    etag: string;
};
export declare function localToTask(local: {
    title: string;
    notes?: string;
    dueMs?: number;
    completedMs?: number;
}): any;
export {};
//# sourceMappingURL=google-sync.d.ts.map