interface.ts 796 字节
Newer Older
1
import { Maps, Map } from '../maps'
2
import { Polygon as QQPolygon, PolygonOptions as QQPolygonOptions } from '../maps/qq/types'
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
import { Polygon as GPolygon } from '../maps/google/types'
import { useCustomEvent } from '@dcloudio/uni-components'
import props from './props'

export interface Point {
  latitude: number
  longitude: number
}

export type CustomEventTrigger = ReturnType<typeof useCustomEvent>

type OnMapReadyCallback = (
  map: Map,
  maps: Maps,
  trigger: CustomEventTrigger
) => void

export type OnMapReady = (callback: OnMapReadyCallback) => void

export type Polygon = QQPolygon | GPolygon

24 25
export type PolygonOptions = QQPolygonOptions & google.maps.PolygonOptions

26 27 28 29 30
export type Props = Record<keyof typeof props, any>

export interface EventObj {
  [key: string]: string
}