UNPKG

t-comm

Version:

专业、稳定、纯粹的工具库

69 lines (68 loc) 1.76 kB
export interface LocationData { lat: number; lng: number; type?: string; } export declare enum LocationFlag { LocationSuccess = 1, LocationIpSuccess = 2, LocationFailed = 3 } export type LocationResult = { location: LocationData; flag: LocationFlag; }; export interface LocationInterface { getLocation(options?: LocationOptions): Promise<LocationResult>; } export interface LocationOptions { timeout: number; useWxSdk: boolean; useTipSdk: boolean; useTencentMap: boolean; useTencentMapIfFail: boolean; useTencentMapApi: boolean; useSlugSdk: boolean; useMsdk: boolean; sessionCache: boolean; localCache: boolean; localExpireMs: number; useH5Geolocation: boolean; showTipLocationUsageAlert: boolean; tipLocationUsageDesc: string; needAllowLocation: boolean; forceUpdateLocation: boolean; Dialog?: { confirm: (_: any) => Promise<any>; }; useMsdkLocation?: boolean; msdkLocationReqStr?: string; fetchLBSRequest?: () => Promise<{ ip_result: { location: { lat: number; lng: number; }; ip: number; ad_info: any; }; }>; fetchTipSdkLBSRequest?: () => Promise<{ lbsinfo?: { gpsinfo: { lat: number | string; lng: number | string; }; netinfo: { iplat: number | string; iplng: number | string; }; }; }>; configWx?: (apiList: Array<string>, openTagList: Array<string>) => Promise<any>; } export declare const tencentMapConfig: { GEO_KEY: string; GEO_KEY_PLUS: string; GEO_REFERER: string; };