diff --git a/packages/aris-source-google-calendar/src/google-calendar-source.ts b/packages/aris-source-google-calendar/src/google-calendar-source.ts index 8a99b4f..8e384ec 100644 --- a/packages/aris-source-google-calendar/src/google-calendar-source.ts +++ b/packages/aris-source-google-calendar/src/google-calendar-source.ts @@ -4,10 +4,29 @@ import type { ApiCalendarEvent, CalendarEventData, GoogleCalendarClient, - GoogleCalendarSourceOptions, + GoogleOAuthProvider, } from "./types" import { NextEventKey, type NextEvent } from "./calendar-context" + +interface GoogleCalendarSourceBaseOptions { + calendarIds?: string[] + lookaheadHours?: number +} + +interface GoogleCalendarSourceWithProvider extends GoogleCalendarSourceBaseOptions { + oauthProvider: GoogleOAuthProvider + client?: never +} + +interface GoogleCalendarSourceWithClient extends GoogleCalendarSourceBaseOptions { + oauthProvider?: never + client: GoogleCalendarClient +} + +export type GoogleCalendarSourceOptions = + | GoogleCalendarSourceWithProvider + | GoogleCalendarSourceWithClient import { CalendarFeedItemType, type CalendarFeedItem } from "./feed-items" import { DefaultGoogleCalendarClient } from "./google-calendar-api" diff --git a/packages/aris-source-google-calendar/src/index.ts b/packages/aris-source-google-calendar/src/index.ts index 4223bbc..3549014 100644 --- a/packages/aris-source-google-calendar/src/index.ts +++ b/packages/aris-source-google-calendar/src/index.ts @@ -7,7 +7,7 @@ export { type CalendarFeedItem, } from "./feed-items" export { DefaultGoogleCalendarClient } from "./google-calendar-api" -export { GoogleCalendarSource } from "./google-calendar-source" +export { GoogleCalendarSource, type GoogleCalendarSourceOptions } from "./google-calendar-source" export { EventStatus, type EventStatus as EventStatusType, @@ -15,7 +15,6 @@ export { type ApiEventDateTime, type CalendarEventData, type GoogleCalendarClient, - type GoogleCalendarSourceOptions, type GoogleOAuthProvider, type ListEventsOptions, } from "./types" diff --git a/packages/aris-source-google-calendar/src/types.ts b/packages/aris-source-google-calendar/src/types.ts index 307de0d..a88c465 100644 --- a/packages/aris-source-google-calendar/src/types.ts +++ b/packages/aris-source-google-calendar/src/types.ts @@ -53,23 +53,3 @@ export interface GoogleCalendarClient { listCalendarIds(): Promise listEvents(options: ListEventsOptions): Promise } - -interface GoogleCalendarSourceBaseOptions { - calendarIds?: string[] - /** Default: 24 */ - lookaheadHours?: number -} - -interface GoogleCalendarSourceWithProvider extends GoogleCalendarSourceBaseOptions { - oauthProvider: GoogleOAuthProvider - client?: never -} - -interface GoogleCalendarSourceWithClient extends GoogleCalendarSourceBaseOptions { - oauthProvider?: never - client: GoogleCalendarClient -} - -export type GoogleCalendarSourceOptions = - | GoogleCalendarSourceWithProvider - | GoogleCalendarSourceWithClient