UNPKG

@remcostoeten/fync

Version:

A unified TypeScript library for easy access to popular APIs (GitHub, Spotify, GitLab, etc.)

27 lines 1.55 kB
import type { TCalendarColors, TCalendarEvent, TCalendarListEntry, TCalendarListParams, TCalendarMetadata, TEventListParams, TFreeBusy, TFreeBusyParams } from "./types"; type TGoogleCalendarConfig = { accessToken: string; cache?: boolean; cacheTTL?: number; }; declare function createCalendarService(config: TGoogleCalendarConfig): { getCalendars: (params?: TCalendarListParams) => Promise<TCalendarListEntry[]>; getCalendar: (calendarId: string) => Promise<TCalendarMetadata>; getEvents: (calendarId?: string, params?: TEventListParams) => Promise<TCalendarEvent[]>; getEvent: (calendarId: string, eventId: string) => Promise<TCalendarEvent>; getUpcomingEvents: (calendarId?: string, maxResults?: number) => Promise<TCalendarEvent[]>; getEventsInDateRange: (calendarId: string | undefined, startDate: Date, endDate: Date) => Promise<TCalendarEvent[]>; getTodaysEvents: (calendarId?: string) => Promise<TCalendarEvent[]>; searchEvents: (query: string, calendarId?: string, maxResults?: number) => Promise<TCalendarEvent[]>; getColors: () => Promise<TCalendarColors>; getFreeBusy: (params: TFreeBusyParams) => Promise<TFreeBusy>; isTimeSlotBusy: (calendarId: string, startTime: Date, endTime: Date) => Promise<boolean>; getAllCalendarEvents: (maxResults?: number) => Promise<{ calendar: TCalendarListEntry; events: TCalendarEvent[]; }[]>; }; export { createCalendarService }; export type { TGoogleCalendarConfig }; export * from "./types"; //# sourceMappingURL=index.d.ts.map