Просмотр исходного кода

googleCalendarApiKey added to typescript options definition. fixes #4772

Adam Shaw 6 лет назад
Родитель
Сommit
0f1a2d96da
2 измененных файлов с 17 добавлено и 1 удалено
  1. 1 0
      CHANGELOG.md
  2. 16 1
      packages/google-calendar/src/main.ts

+ 1 - 0
CHANGELOG.md

@@ -2,6 +2,7 @@
 next
 ----
 
+- googleCalendarApiKey added to typescript options definition (#4772)
 - sourcemaps removed from dist (accidentally included in previous version)
 - moment/luxon formatting same-day range with dash (#4686)
 - error importing moment plugin into typescript project (#4691, #4680, #4580)

+ 16 - 1
packages/google-calendar/src/main.ts

@@ -3,13 +3,28 @@ import { createPlugin, EventSourceDef, refineProps, addDays, DateEnv, requestJso
 // TODO: expose somehow
 const API_BASE = 'https://www.googleapis.com/calendar/v3/calendars'
 
-const STANDARD_PROPS = {
+const STANDARD_PROPS = { // for event source parsing
   url: String,
   googleCalendarApiKey: String, // TODO: rename with no prefix?
   googleCalendarId: String,
   data: null
 }
 
+
+declare module '@fullcalendar/core' {
+  interface OptionsInput {
+    googleCalendarApiKey?: string
+  }
+}
+
+declare module '@fullcalendar/core/structs/event-source' {
+  interface ExtendedEventSourceInput {
+    googleCalendarApiKey?: string
+    googleCalendarId?: string
+  }
+}
+
+
 let eventSourceDef: EventSourceDef = {
 
   parseMeta(raw) {