Kubessandra / react-google-calendar-api

An api to manage your google calendar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ApiCalendar any type

Hjkun77 opened this issue · comments

Variable 'ApiCalendar' implicitly has type 'any' in some locations where its type cannot be determined.ts(7034)

same here

What is your import?

The one stated in the README.md for typescript @Kubessandra

If you try adding .ts for the extension of the import does it work?

If you try adding .ts for the extension of the import does it work?
You mean import ApiCalendar from 'react-google-calendar-api/src/ApiCalendar.ts';?
If so, doesn't work...

Yep adding .ts doesn't work as well.

The types any in the dependency is throwing an error.

Yep adding .ts doesn't work as well.

The types any in the dependency is throwing an error.

Yes It's not working....

Screenshot 2022-04-20 at 12 13 02 PM

This is the compile error received:

Compiled with problems:X

ERROR in node_modules/react-google-calendar-api/src/ApiCalendar.ts:44:24

TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.
42 | */
43 | private initClient(): void {

44 | this.gapi = window['gapi'];
| ^^^^^^
45 | this.gapi.client
46 | .init(Config)
47 | .then(() => {

ERROR in node_modules/react-google-calendar-api/src/ApiCalendar.ts:70:24

TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.
68 | */
69 | private handleClientLoad(): void {

70 | this.gapi = window['gapi'];
| ^^^^^^
71 | const script = document.createElement('script');
72 | script.src = 'https://apis.google.com/js/api.js';
73 | document.body.appendChild(script);

ERROR in node_modules/react-google-calendar-api/src/ApiCalendar.ts:75:14

TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.
73 | document.body.appendChild(script);
74 | script.onload = (): void => {

75 | window['gapi'].load('client:auth2', this.initClient);
| ^^^^^^
76 | };
77 | }
78 |

Hi,
This has been fixed commit version [> 2.0.x]

This include a lot of changes if you have any feedbacks / questions do not hesitate