chore: remove obvious comments from types

Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
2026-02-14 15:24:55 +00:00
parent 512faf191e
commit c7a1048320

View File

@@ -1,14 +1,6 @@
/**
* Provider interface for Google OAuth credentials.
* Consumers implement this to supply tokens from their auth storage/flow.
* The source never stores or manages tokens itself.
*/
export interface GoogleOAuthProvider {
/** Return a valid access token, refreshing internally if necessary. */
fetchAccessToken(): Promise<string>
/** Force a token refresh and return the new access token. */
refresh(): Promise<string>
/** Revoke the current credentials. */
revoke(): Promise<void>
}
@@ -20,14 +12,13 @@ export const EventStatus = {
export type EventStatus = (typeof EventStatus)[keyof typeof EventStatus]
/** Google Calendar API event datetime object. Exactly one of dateTime or date is present. */
/** Exactly one of dateTime or date is present. */
export interface ApiEventDateTime {
dateTime?: string
date?: string
timeZone?: string
}
/** Google Calendar API event resource shape. */
export interface ApiCalendarEvent {
id: string
status: EventStatus
@@ -58,33 +49,24 @@ export interface ListEventsOptions {
timeMax: Date
}
/**
* Abstraction over the Google Calendar REST API.
* Inject a mock for testing.
*/
export interface GoogleCalendarClient {
/** List all calendar IDs accessible by the user. */
listCalendarIds(): Promise<string[]>
/** List events matching the given options. Returns raw API event objects. */
listEvents(options: ListEventsOptions): Promise<ApiCalendarEvent[]>
}
interface GoogleCalendarSourceBaseOptions {
/** Calendar IDs to fetch. Defaults to all user calendars. */
calendarIds?: string[]
/** How far ahead to look for events, in hours. Default: 24 */
/** Default: 24 */
lookaheadHours?: number
}
interface GoogleCalendarSourceWithProvider extends GoogleCalendarSourceBaseOptions {
/** OAuth provider for authenticating with Google Calendar API */
oauthProvider: GoogleOAuthProvider
client?: never
}
interface GoogleCalendarSourceWithClient extends GoogleCalendarSourceBaseOptions {
oauthProvider?: never
/** Injectable API client (for testing) */
client: GoogleCalendarClient
}