terra-draw
Version:
Frictionless map drawing across mapping provider
30 lines (29 loc) • 1.52 kB
TypeScript
/**
* For this specific test suite we should only ever import from the Terra Draw
* public API, and not from the internal library code. This is to ensure that
* a developer can write a custom adapter exclusively from the publicly exposed base
* classes and types of the library.
*/
import { GetLngLatFromEvent, Project, SetCursor, TerraDrawChanges, TerraDrawExtend, TerraDrawStylingFunction, Unproject } from "./terra-draw";
declare const TerraDrawBaseAdapter: typeof TerraDrawExtend.TerraDrawBaseAdapter;
/**
* A mock implementation of a custom adapter - this is to ensure that it is possible to write
* custom adapters for Terra Draw exclusively relying on the public API of the library.
*/
export declare class TerraDrawTestAdapter extends TerraDrawBaseAdapter {
constructor(config: {
lib: Record<string, unknown>;
} & TerraDrawExtend.BaseAdapterConfig);
getMapEventElement(): HTMLElement;
clear(): void;
project(lng: number, lat: number): ReturnType<Project>;
unproject(x: number, y: number): ReturnType<Unproject>;
setCursor(_: "move" | "unset" | "grab" | "grabbing" | "crosshair" | "pointer" | "wait"): ReturnType<SetCursor>;
getLngLatFromEvent(_: PointerEvent | MouseEvent): ReturnType<GetLngLatFromEvent>;
setDraggability(_: boolean): void;
setDoubleClickToZoom(_: boolean): void;
render(_1: TerraDrawChanges, _2: TerraDrawStylingFunction): void;
register(callbacks: TerraDrawExtend.TerraDrawCallbacks): void;
unregister(): void;
}
export {};