/** * Drawing (doc ยง37): clicks become generic geometry. The engine owns the interaction and the draft; the application * receives a Geometry and decides what it means (an annotation, a search area, a geofence). */ import type { Geometry, MapLayer, Position, SpatialObject } from '../core/types.js'; export type DrawKind = 'point' | 'line' | 'polygon' | 'rectangle' | 'circle'; export interface DrawingState { kind: DrawKind; /** Clicked positions so far. Rectangle: two corners. Circle: centre, then a point on the edge. */ points: Position[]; /** Enough points to finish, and the shape is valid. */ canFinish: boolean; /** Why the shape cannot be finished as it is (e.g. a polygon whose edges cross), for the application to show. */ problem?: string; } export declare const minPoints: (kind: DrawKind) => number; export declare const autoFinishes: (kind: DrawKind, points: number) => boolean; /** The geometry a finished drawing produces, or null if there are not enough points. */ export declare function drawnGeometry(kind: DrawKind, pts: Position[]): Geometry | null; /** Internal scene layers that show the draft. They are never returned by getLayers() and cannot be selected. */ export declare const DRAFT_LAYER_IDS: { readonly area: "__draft-area"; readonly line: "__draft-line"; readonly vertices: "__draft-vertices"; }; export declare const DRAFT_LAYERS: MapLayer[]; /** Draft objects per internal layer: the shape so far, its outline, and the clicked vertices. */ export declare function draftObjects(state: DrawingState | null): Record;