You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using gapi via global script, and then type definitions are added to the global.d.ts file, gapi is recognized as a valid namespace in the script block but language tools gives an error when used in the template (like an await block or on:click inline function. Things still work as expected, but there is a warning, 'gapi' is not defined svelte(missing-declaration)
To Reproduce
add <script src="https://apis.google.com/js/api.js" type="text/javascript"></script> to app.html
npm i -D @types/gapi.auth2 @types/gapi.client.calendar
add /// <reference types="gapi.client.calendar" /> to global.d.ts
Use await gapi.client.calendar.calendarList.list() in script block and inline {#await} block to see warning in just latter case.
Expected behavior
No warning.
Screenshots
System (please complete the following information):
OS: Windows
IDE: VSCode
Plugin: "Svelte for VSCode"
Additional context
Low priority as the typings still work and I can just use <!-- svelte-ignore missing-declaration --> but I thought you should know.
The text was updated successfully, but these errors were encountered:
This is a warning from the Svelte compiler. It doesn't know that there's a global with that name. Currently (and I guess there won't be) there's no way to tell the compiler about additional globals, so ignoring/silencing the error is the best option. Once #855 is tackled that would be a way to deal with it globally.
Describe the bug
When using gapi via global script, and then type definitions are added to the global.d.ts file, gapi is recognized as a valid namespace in the script block but language tools gives an error when used in the template (like an await block or on:click inline function. Things still work as expected, but there is a warning,
'gapi' is not defined svelte(missing-declaration)
To Reproduce
<script src="https://apis.google.com/js/api.js" type="text/javascript"></script>
to app.htmlnpm i -D @types/gapi.auth2 @types/gapi.client.calendar
/// <reference types="gapi.client.calendar" />
to global.d.tsawait gapi.client.calendar.calendarList.list()
in script block and inline {#await} block to see warning in just latter case.Expected behavior
No warning.
Screenshots

System (please complete the following information):
Additional context
Low priority as the typings still work and I can just use
<!-- svelte-ignore missing-declaration -->
but I thought you should know.The text was updated successfully, but these errors were encountered: