/** * Calendar event methods: create and update calendar events */ import type { CalendarEventUpdateData, CreateCalendarEventOptions, CreateCalendarEventPayload, UpdateCalendarEventOptions, UpdateCalendarEventPayload } from '../../types/index.js'; import { TaskSchedulingMethods } from './task-scheduling.js'; export declare abstract class CalendarEventMethods extends TaskSchedulingMethods { /** * Creates a new calendar event * * Creates a calendar event in Sunsama and optionally syncs it to an external * calendar service (e.g., Google Calendar). The event can be linked to an * existing task via the `seedTaskId` option. * * @param title - The title of the calendar event * @param startDate - Start date/time as Date object or ISO string * @param endDate - End date/time as Date object or ISO string * @param options - Additional event properties * @returns The created calendar event result with success status * @throws SunsamaAuthError if not authenticated * @throws SunsamaValidationError if start date is after end date * @throws SunsamaError if unable to determine user context * * @example * ```typescript * // Create a simple 30-minute event * const result = await client.createCalendarEvent( * 'Team standup', * '2026-02-21T09:00:00.000Z', * '2026-02-21T09:30:00.000Z' * ); * * // Create an event with options * const result = await client.createCalendarEvent( * 'Project review', * new Date('2026-02-21T14:00:00Z'), * new Date('2026-02-21T15:00:00Z'), * { * description: 'Review Q1 progress', * streamIds: ['stream-id-1'], * visibility: 'public', * } * ); * * // Create an event linked to a task * const result = await client.createCalendarEvent( * 'Work on feature', * '2026-02-21T10:00:00.000Z', * '2026-02-21T11:00:00.000Z', * { seedTaskId: 'existing-task-id' } * ); * ``` */ createCalendarEvent(title: string, startDate: Date | string, endDate: Date | string, options?: CreateCalendarEventOptions): Promise; /** * Updates a calendar event * * This method allows you to update a calendar event's properties such as title, date, * location, invitees, and more. It requires the full event update data object and the * event ID. * * @param eventId - The ID of the calendar event to update * @param update - The calendar event update data containing all event fields * @param options - Additional options for the operation * @returns The update result with the updated calendar event and success status * @throws SunsamaError if not authenticated, no response data, or missing user context * * @example * ```typescript * const result = await client.updateCalendarEvent('eventId123', { * _id: 'eventId123', * createdBy: 'userId', * title: 'Updated Meeting Title', * date: { * startDate: '2026-02-22T10:00:00.000Z', * endDate: '2026-02-22T11:00:00.000Z', * isAllDay: null, * timeZone: null, * }, * // ... other required fields * }); * ``` */ updateCalendarEvent(eventId: string, update: CalendarEventUpdateData, options?: UpdateCalendarEventOptions): Promise; } //# sourceMappingURL=calendar-events.d.ts.map