I’m working on a project where I need to create calendar events using the Google Calendar API in TypeScript. I want to get proper type definitions for the event object that gets passed to calendar.events.insert().
const appointment: CalendarEventPayload = {
summary: 'Team standup meeting',
location: '1234 Main Street, New York, NY 10001',
description: 'Weekly team sync to discuss project updates and blockers',
colorId: 2,
start: {
dateTime: startDateTime,
timeZone: 'America/New_York',
},
end: {
dateTime: endDateTime,
timeZone: 'America/New_York',
},
}
Right now I don’t have any type checking on this object and I keep making mistakes with the property names. Is there a way to import the correct TypeScript interface for this request body from the Google APIs library?