import { type LoaderOptions } from "@googlemaps/js-api-loader"; import { load as loadAmap } from "@heycar/amap-jsapi-loader"; import { type Ref } from "vue-demi"; import type { VNodeChild } from "../demi-polyfill"; import type { ConnectionStatus, Language } from "../types/interface"; export declare const DEFAULT_AMAP_PLUGINS: AmapLoaderProps["plugins"]; export declare const DEFAULT_GMAP_LIBRARIES: LoaderOptions["libraries"]; export declare enum Status { LOADING = "LOADING", FAILURE = "FAILURE", SUCCESS = "SUCCESS" } type AMapLoaderOptions = Parameters[0]; declare global { interface Window { _AMapSecurityConfig: { securityJsCode?: string; serviceHost?: string; }; } } export interface AmapLoaderProps extends Pick, Omit { apiKey: string; apiSecret?: string; apiServiceHost?: string; version?: string; plugins?: `AMap.${AMap.PluginName}`[]; disableRef?: Ref; } export declare const useAmapLoader: (props: AmapLoaderProps) => { statusRef: import("vue-demi").ShallowRef; pingStatusRef: import("vue-demi").ShallowRef; readyPromise: Promise; }; export interface GmapLoaderProps extends LoaderOptions { disableRef?: Ref; /** * Render prop used to switch to loading component. */ loading?: () => VNodeChild; /** * Render prop used to switch to error fallback component. */ fallback?: () => VNodeChild; /** * 成功回调只会触发一次 */ onSuccess?: () => void; /** * 失败回调可能会触发多次 */ onFail?: () => void; /** * 只会触发一次,地图下载优化结束时,可以将字体等延迟到此时再加载 * @param duration 优化耗时 */ onDownloadOptimizeEnd?: (duration: number) => void; } export declare const useGmapLoader: (props: GmapLoaderProps) => { statusRef: import("vue-demi").ShallowRef; pingStatusRef: import("vue-demi").ShallowRef; readyPromise: Promise; }; export type MapSupplier = "gmap" | "amap"; export interface UseMapLoaderOutput { statusRef: Ref; pingStatusRef: Ref; readyPromise: Promise; } export interface UseMapLoaderProps { gmapKey: string; amapKey: string; amapSecret?: string; amapServiceHost?: string; supplier: MapSupplier; language: Language; onSuccess?: () => void; onFail?: () => void; onDownloadOptimizeEnd?: (duration: number) => void; } export declare const useMapLoader: (props: UseMapLoaderProps) => UseMapLoaderOutput; export {};