UNPKG

@nuxt/scripts

Version:

Load third-party scripts with better performance, privacy and DX in Nuxt Apps.

224 lines (223 loc) 7.98 kB
export interface PlaceholderOptions { width?: string | number; height?: string | number; center?: string; zoom?: number; size?: string; scale?: number; format?: 'png' | 'jpg' | 'gif' | 'png8' | 'png32' | 'jpg-baseline'; maptype?: 'roadmap' | 'satellite' | 'terrain' | 'hybrid'; language?: string; region?: string; markers?: string; path?: string; visible?: string; style?: string; map_id?: string; key?: string; signature?: string; } import type { HTMLAttributes, ImgHTMLAttributes, InjectionKey, Ref, ReservedProps, ShallowRef } from 'vue'; import type { ElementScriptTrigger } from '#nuxt-scripts/types'; export declare const MAP_INJECTION_KEY: InjectionKey<{ map: ShallowRef<google.maps.Map | undefined>; mapsApi: Ref<typeof google.maps | undefined>; }>; declare const _default: typeof __VLS_export; export default _default; declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{ /** * Defines the trigger event to load the script. */ trigger?: ElementScriptTrigger; /** * Is Google Maps being rendered above the fold? * This will load the placeholder image with higher priority. */ aboveTheFold?: boolean; /** * Defines the Google Maps API key. Must have access to the Static Maps API as well. */ apiKey?: string; /** * A latitude / longitude of where to focus the map. */ center?: google.maps.LatLng | google.maps.LatLngLiteral | `${string},${string}`; /** * Should a marker be displayed on the map where the centre is. */ centerMarker?: boolean; /** * Options for the map. */ mapOptions?: google.maps.MapOptions; /** * Defines the region of the map. */ region?: string; /** * Defines the language of the map */ language?: string; /** * Defines the version of google maps js API */ version?: string; /** * Defines the width of the map. */ width?: number | string; /** * Defines the height of the map */ height?: number | string; /** * Customize the placeholder image attributes. * * @see https://developers.google.com/maps/documentation/maps-static/start. */ placeholderOptions?: PlaceholderOptions; /** * Customize the placeholder image attributes. */ placeholderAttrs?: ImgHTMLAttributes & ReservedProps & Record<string, unknown>; /** * Customize the root element attributes. */ rootAttrs?: HTMLAttributes & ReservedProps & Record<string, unknown>; /** * Extra Markers to add to the map. */ markers?: (`${string},${string}` | google.maps.marker.AdvancedMarkerElementOptions)[]; }, { readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>; readonly map: ShallowRef<google.maps.Map | undefined>; readonly createAdvancedMapMarker: (_options?: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`) => Promise<google.maps.marker.AdvancedMarkerElement | undefined>; readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | undefined>; readonly importLibrary: { (key: "marker"): Promise<google.maps.MarkerLibrary>; (key: "places"): Promise<google.maps.PlacesLibrary>; (key: "geometry"): Promise<google.maps.GeometryLibrary>; (key: "drawing"): Promise<google.maps.DrawingLibrary>; (key: "visualization"): Promise<google.maps.VisualizationLibrary>; (key: string): Promise<any>; }; }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { error: () => any; ready: (e: { readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>; readonly map: ShallowRef<google.maps.Map | undefined>; readonly createAdvancedMapMarker: (_options?: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`) => Promise<google.maps.marker.AdvancedMarkerElement | undefined>; readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | undefined>; readonly importLibrary: { (key: "marker"): Promise<google.maps.MarkerLibrary>; (key: "places"): Promise<google.maps.PlacesLibrary>; (key: "geometry"): Promise<google.maps.GeometryLibrary>; (key: "drawing"): Promise<google.maps.DrawingLibrary>; (key: "visualization"): Promise<google.maps.VisualizationLibrary>; (key: string): Promise<any>; }; }) => any; }, string, import("vue").PublicProps, Readonly<{ /** * Defines the trigger event to load the script. */ trigger?: ElementScriptTrigger; /** * Is Google Maps being rendered above the fold? * This will load the placeholder image with higher priority. */ aboveTheFold?: boolean; /** * Defines the Google Maps API key. Must have access to the Static Maps API as well. */ apiKey?: string; /** * A latitude / longitude of where to focus the map. */ center?: google.maps.LatLng | google.maps.LatLngLiteral | `${string},${string}`; /** * Should a marker be displayed on the map where the centre is. */ centerMarker?: boolean; /** * Options for the map. */ mapOptions?: google.maps.MapOptions; /** * Defines the region of the map. */ region?: string; /** * Defines the language of the map */ language?: string; /** * Defines the version of google maps js API */ version?: string; /** * Defines the width of the map. */ width?: number | string; /** * Defines the height of the map */ height?: number | string; /** * Customize the placeholder image attributes. * * @see https://developers.google.com/maps/documentation/maps-static/start. */ placeholderOptions?: PlaceholderOptions; /** * Customize the placeholder image attributes. */ placeholderAttrs?: ImgHTMLAttributes & ReservedProps & Record<string, unknown>; /** * Customize the root element attributes. */ rootAttrs?: HTMLAttributes & ReservedProps & Record<string, unknown>; /** * Extra Markers to add to the map. */ markers?: (`${string},${string}` | google.maps.marker.AdvancedMarkerElementOptions)[]; }> & Readonly<{ onError?: (() => any) | undefined; onReady?: ((e: { readonly googleMaps: Ref<typeof google.maps | undefined, typeof google.maps | undefined>; readonly map: ShallowRef<google.maps.Map | undefined>; readonly createAdvancedMapMarker: (_options?: google.maps.marker.AdvancedMarkerElementOptions | `${string},${string}`) => Promise<google.maps.marker.AdvancedMarkerElement | undefined>; readonly resolveQueryToLatLang: (query: string) => Promise<google.maps.LatLng | undefined>; readonly importLibrary: { (key: "marker"): Promise<google.maps.MarkerLibrary>; (key: "places"): Promise<google.maps.PlacesLibrary>; (key: "geometry"): Promise<google.maps.GeometryLibrary>; (key: "drawing"): Promise<google.maps.DrawingLibrary>; (key: "visualization"): Promise<google.maps.VisualizationLibrary>; (key: string): Promise<any>; }; }) => any) | undefined; }>, { trigger: ElementScriptTrigger; centerMarker: boolean; width: number | string; height: number | string; }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, { placeholder?: (props: { placeholder: any; }) => any; } & { loading?: (props: {}) => any; } & { awaitingLoad?: (props: {}) => any; } & { error?: (props: {}) => any; } & { default?: (props: {}) => any; }>; type __VLS_WithSlots<T, S> = T & { new (): { $slots: S; }; };