/** * The Calendar layer: events across accounts, and free/busy arithmetic. * * Everything that touches `calendar_v3` lives here so the rest of the codebase * works with the clean types from `./types.js`. The scope gate is in * `AccountClientCache`, which every function below goes through. */ import { type calendar_v3 } from '@googleapis/calendar'; import type { AccountId } from '../core/errors.js'; import type { CalendarEventInfo, EventPatchRequest, EventWriteRequest, FreeTimeResult, MultiAccountEvents, SendUpdates } from './types.js'; /** Resolves an account reference (email or alias) and returns a ready client. */ export declare function calendarFor(reference: AccountId): Promise<{ email: AccountId; api: calendar_v3.Calendar; }>; export interface ListEventsOptions { timeMin: string; timeMax: string; calendarId?: string; maxResults?: number; /** Free-text search over summary, description, location and attendees. */ query?: string; } /** Lists one account's events in a range. Throws on failure. */ export declare function listEvents(reference: AccountId, options: ListEventsOptions): Promise; /** Lists events across every configured account and merges them by start time. */ export declare function listEventsAllAccounts(options: ListEventsOptions): Promise; export declare function getEvent(reference: AccountId, eventId: string, calendarId?: string): Promise; export declare function createEvent(reference: AccountId, request: EventWriteRequest): Promise; export declare function updateEvent(reference: AccountId, eventId: string, patch: EventPatchRequest): Promise; export interface DeleteResult { account: AccountId; calendarId: string; eventId: string; deleted: true; /** What the event was, read before deleting, so the answer is not just "ok". */ summary: string | null; start: string | null; } export declare function deleteEvent(reference: AccountId, eventId: string, calendarId?: string, sendUpdates?: SendUpdates): Promise; export interface FreeTimeOptions { timeMin: string; timeMax: string; timezone?: string; workdayStart?: string; workdayEnd?: string; weekdaysOnly?: boolean; minimumMinutes?: number; /** Restrict to a subset of accounts. Omitted means every configured account. */ accounts?: string[]; calendarId?: string; } /** * Finds gaps that are free on EVERY account asked about. * * The contract, because this is the one tool where a wrong answer looks exactly * like a right one: * * - `time_min` / `time_max` must carry an explicit offset. No naked local times. * - Working hours are interpreted in `timezone` (IANA), which defaults to the * zone this server runs in and is always echoed back in the result. * - A busy block that overlaps a candidate window only partially still removes * the overlapping part. Half a busy hour is not free. * - If ANY account fails, no slots are returned at all. A gap computed without * one person's calendar is a double-booking waiting to happen. */ export declare function findFreeTime(options: FreeTimeOptions): Promise; //# sourceMappingURL=client.d.ts.map