UNPKG

1.19 kBTypeScriptView Raw
1/// <reference types="amap-js-api" />
2import { IControl } from 'mapbox-gl';
3
4interface Window {
5 initAMap: () => void;
6}
7interface IAMapEvent {
8 camera: {
9 fov: number;
10 near: number;
11 far: number;
12 height: number;
13 pitch: number;
14 rotation: number;
15 aspect: number;
16 position: { x: number; y: number };
17 };
18}
19
20interface CustomCoords {
21 getCameraParams(): void;
22 getCenter(): void;
23 getMVPMatrix(): void;
24 [other:string]:any
25}
26interface IAMapInstance {
27 get(key: string): unknown;
28 getZooms?(): number[];
29 customCoords?: CustomCoords;
30}
31
32interface IMapboxInstance {
33 _controls: IControl[];
34 transform: {
35 width: number;
36 height: number;
37 };
38}
39interface IEventEmitter<EventTypes extends string | symbol = string | symbol> {
40 emit(event: EventTypes, ...args: any[]): boolean;
41 /**
42 * Add a listener for a given event.
43 */
44 on(event: EventTypes, handle: (...args: any[]) => void, context?: any): this;
45
46 off(
47 event: EventTypes,
48 handle: (...args: any[]) => void,
49 context?: any,
50 once?: boolean,
51 ): this;
52
53 /**
54 * Remove all listeners, or those of the specified event.
55 */
56 removeAllListeners(event?: EventTypes): this;
57}