import Class, { ClassOptions } from '../core/Class'; import Point from '../geo/Point'; import Map from '../map/Map'; declare const Control_base: { new (...args: any[]): { _eventMap?: Record; _eventParent?: any; _eventTarget?: any; on(eventsOn: string | import("../core/Eventable").EventRecords, handler: import("../core/Eventable").HandlerFn, context?: any): any; addEventListener(...args: any[]): any; once(eventTypes: string | import("../core/Eventable").EventRecords, handler: import("../core/Eventable").HandlerFn, context?: any): any; off(eventsOff: string | import("../core/Eventable").EventRecords, handler: import("../core/Eventable").HandlerFn, context?: any): any; removeEventListener(...args: any[]): any; listens(eventType: string, handler?: import("../core/Eventable").HandlerFn, context?: any): number; getListeningEvents(): string[]; copyEventListeners(target: any): any; fire(eventType: string, param?: import("../core/Eventable").BaseEventParamsType): any; _wrapOnceHandler(evtType: string, handler: import("../core/Eventable").HandlerFn, context?: any): (...args: any[]) => void; _switch(to: string, eventRecords: import("../core/Eventable").EventRecords, context?: any): any; _clearListeners(eventType: string): void; _clearAllListeners(): void; _setEventParent(parent: any): any; _setEventTarget(target: any): any; _fire(eventType: string, param: import("../core/Eventable").BaseEventParamsType): any; }; } & typeof Class; /** * Base class for all the map controls, you can extend it to build your own customized Control. * It is abstract and not intended to be instantiated. * @category control * @memberOf control * @abstract * @extends Class * @mixes Eventable */ declare abstract class Control extends Control_base { options: ControlOptionsType & T; static positions: { [key: string]: DomPositionType; }; /** * Methods needs to implement:
*
* 1. Method to create UI's Dom element
* function buildOn : HTMLElement
*
* 2. Optional, a callback when the control is added.
* function onAdd : void
* 3. Optional, a callback when the control is removed.
* function onRemove : void
*
* @param {Object} [options=null] configuration options */ constructor(options: ControlOptionsType & T); onAdd(): void; onRemove(): void; abstract buildOn(map?: Map): HTMLElement; /** * Adds the control to a map. * @param {Map} map * @returns {control.Control} this * @fires control.Control#add */ addTo(map: Map): this; /** * update control container * @return {control.Control} this */ update(): this; /** * Get the map that the control is added to. * @return {Map} */ getMap(): Map; /** * Get the position of the control * @return {Object} */ getPosition(): DomPositionType; /** * update the control's position * @param {String|Object} position - can be one of 'top-left', 'top-right', 'bottom-left', 'bottom-right' or a position object like {'top': 40,'left': 60} * @return {control.Control} this * @fires control.Control#positionchange */ setPosition(position: ControlPositionType): this; /** * Get the container point of the control. * @return {Point} */ getContainerPoint(): Point; /** * Get the control's container. * Container is a div element wrapping the control's dom and decides the control's position and display. * @return {HTMLElement} */ getContainer(): HTMLElement; /** * Get html dom element of the control * @return {HTMLElement} */ getDOM(): HTMLElement; /** * Show * @return {control.Control} this */ show(): this; /** * Hide * @return {control.Control} this */ hide(): this; /** * Whether the control is visible * @return {Boolean} */ isVisible(): boolean; /** * Remove itself from the map * @return {control.Control} this * @fires control.Control#remove */ remove(): this; onConfig(conf: ClassOptions): void; } export type DomPositionType = { top?: number | string; bottom?: number | string; left?: number | string; right?: number | string; }; export type ControlPositionType = string | DomPositionType; export type ControlOptionsType = { position?: ControlPositionType; cssName?: string | Array; }; declare module "./../map/Map" { interface Map { addControl(control: Control): this; removeControl(control: Control): this; } } export default Control; //# sourceMappingURL=Control.d.ts.map