/** * Map commands (doc 28 G6): one versioned, declarative set that an agent, an iframe host or any part of an app can * send. Each command maps onto a runtime method — the command set adds no behaviour of its own. A list of commands is * checked as a whole before anything runs: an unknown or invalid command refuses the whole list, never half of it. */ import type { BoundingBox, Geometry, Position, PropertyCondition } from './types.js'; export declare const COMMAND_VERSION = 1; export type MapCommand = { type: 'showLayer'; layerId: string; } | { type: 'hideLayer'; layerId: string; } /** Narrows what a layer loads; `where: []` clears the filter. */ | { type: 'setFilter'; layerId: string; where: PropertyCondition[]; } | { type: 'flyTo'; objectId?: string; position?: Position; zoom?: number; } | { type: 'fitTo'; bounds?: BoundingBox; objectIds?: string[]; } | { type: 'select'; objectIds: string[]; } | { type: 'clearSelection'; } | { type: 'highlight'; objectIds: string[]; durationMs?: number; color?: string; } | { type: 'clearHighlight'; } /** Asks the application to open its details view for an object (the engine has no inspector of its own). */ | { type: 'openInspector'; objectId: string; } /** `at` ISO 8601, or 'live'. */ | { type: 'setTime'; at: string; } /** Asks the application's timeline to play or pause (the application owns time, ADR-010). */ | { type: 'play'; speed?: number; } | { type: 'pause'; } | { type: 'drawProposal'; geometry: Geometry; label?: string; note?: string; id?: string; } | { type: 'clearProposals'; }; export type MapCommandType = MapCommand['type']; export interface CommandResult { ok: boolean; /** How many commands ran (all of them, or none). */ applied: number; /** Why the list was refused: the index and reason of the first bad command. */ error?: { index: number; reason: string; }; /** Values some commands return (e.g. the id of a drawn proposal), by index. */ results?: Record; } export declare const COMMAND_TYPES: readonly ("showLayer" | "hideLayer" | "setFilter" | "flyTo" | "fitTo" | "select" | "clearSelection" | "highlight" | "clearHighlight" | "openInspector" | "setTime" | "play" | "pause" | "drawProposal" | "clearProposals")[]; /** Shape checks of one command (references to layers and objects are checked by the runtime). Null when fine. */ export declare function commandProblem(c: unknown): string | null;