How can it be done - I\'ve tried combinations of
typings install [googlemaps | google.maps] [--ambient] --save
and end up with variations o
I struggled to define the google object on the window, finally found a good way, by extending Window interface.
Just create a google-maps.d.ts file with this:
import '@types/googlemaps';
declare global {
interface Window {
google: typeof google;
}
}
And add it to a directory called types at your root folder.
Then point to this folder in your tsconfig.json file.
// tsconfig.json
compilerOptions: {
...
"typeRoots": [
"node_modules/@types",
"types"
],
...
}