Skip to content

Commit a5934d9

Browse files
committed
chore: broken types
1 parent 1bb0a03 commit a5934d9

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/runtime/components/ScriptGoogleMaps.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ onMounted(() => {
144144
})
145145
// create the map
146146
$script.then(async (instance) => {
147-
const maps = await instance.maps
147+
const maps = await instance.maps as any as typeof google.maps // some weird type issue here
148148
const _map = new maps.Map(mapEl.value!, options.value)
149149
const placesService = new maps.places.PlacesService(_map)
150150

src/runtime/registry/google-maps.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@ export const GoogleMapsOptions = object({
2323

2424
export type GoogleMapsInput = RegistryScriptInput<typeof GoogleMapsOptions>
2525

26+
type MapsNamespace = typeof google.maps
2627
export interface GoogleMapsApi {
27-
maps: typeof window.google.maps
28+
maps: MapsNamespace | Promise<MapsNamespace>
2829
}
2930

3031
declare global {
3132
interface Window {
32-
google: typeof google
33+
google: {
34+
maps: MapsNamespace
35+
}
3336
}
3437
}
3538

src/runtime/registry/vimeo-player.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/// <reference types="vimeo__player" />
21
import { watch } from 'vue'
2+
import type Vimeo from 'vimeo__player'
33
import { useRegistryScript } from '../utils'
44
import type { RegistryScriptInput } from '#nuxt-scripts'
55
import { useHead } from '#imports'
@@ -8,7 +8,7 @@ type Constructor<T extends new (...args: any) => any> = T extends new (...args:
88

99
export interface VimeoPlayerApi {
1010
Vimeo: {
11-
Player: Constructor<typeof window.Vimeo>
11+
Player: Constructor<typeof Vimeo>
1212
}
1313
}
1414

src/runtime/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@ export interface RegistryScript {
126126
logo?: string | { light: string, dark: string }
127127
}
128128

129-
export type ElementScriptTrigger = 'immediate' | 'visible' | keyof GlobalEventHandlersEventMap | (keyof GlobalEventHandlersEventMap)[] | false
129+
export type ElementScriptTrigger = 'immediate' | 'visible' | string | string[] | false
130130

131131
export type RegistryScripts = RegistryScript[]

0 commit comments

Comments
 (0)