-1

if you load the google maps api in the browser using a <script> tag (and not the @google/maps node package), how can you assign typescript types to it? e.g. if I use the @types/googlemaps package or similar, their types look right, but i don't know how to hook them up to my own google variable. seeing some disappointing tsc messages like

Cannot use namespace 'google' as a type.

confused little frowny man

schpet
  • 9,664
  • 6
  • 32
  • 35
  • Does this answer your question? [How to install Typescript typings for google maps](https://stackoverflow.com/questions/36064697/how-to-install-typescript-typings-for-google-maps) – Ulad Kasach Jan 22 '20 at 12:43
  • i already answered my question, it's below – schpet Jan 22 '20 at 20:17

1 Answers1

2

ohhhhhhhh! turns out, i wanted typeof google e.g.

// typescript
var g: typeof google

// js doc
/** @type {typeof google} */
var g
schpet
  • 9,664
  • 6
  • 32
  • 35