30 lines
1.4 KiB
TypeScript
30 lines
1.4 KiB
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(_: Parameters<SetCursor>[0]): 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 {};
|