Skip to content

Commit 573c414

Browse files
authored
fix(googleMaps): fix window type augmentation (#409)
1 parent 18f65e5 commit 573c414

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/runtime/components/ScriptGoogleMaps.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ onMounted(() => {
329329
immediate: true,
330330
})
331331
onLoaded(async (instance) => {
332-
mapsApi.value = await instance.maps as any as typeof google.maps // some weird type issue here
332+
mapsApi.value = await instance.maps
333333
// may need to transform the center before we can init the map
334334
const center = options.value.center as string
335335
const _options: google.maps.MapOptions = {

src/runtime/registry/google-maps.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ export const GoogleMapsOptions = object({
2525

2626
export type GoogleMapsInput = RegistryScriptInput<typeof GoogleMapsOptions>
2727

28-
type MapsNamespace = typeof google.maps
28+
type MapsNamespace = typeof window.google.maps
2929
export interface GoogleMapsApi {
3030
maps: Promise<MapsNamespace>
3131
}
3232

3333
declare global {
3434
interface Window {
3535
google: {
36-
maps: MapsNamespace
36+
maps: {
37+
__ib__(): void
38+
}
3739
}
3840
}
3941
}

0 commit comments

Comments
 (0)