@honua/react 0.1.0-beta.0 → 0.1.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/contract/discovery.d.ts +231 -0
  2. package/contract/discovery.d.ts.map +1 -0
  3. package/contract/discovery.js +554 -0
  4. package/contract/edit-sketch.d.ts +8 -0
  5. package/contract/edit-sketch.d.ts.map +1 -1
  6. package/contract/edit-sketch.js +15 -0
  7. package/contract/edit-snapping.d.ts +160 -0
  8. package/contract/edit-snapping.d.ts.map +1 -0
  9. package/contract/edit-snapping.js +675 -0
  10. package/contract/generated/projjson-v0.7-crs-validator.d.ts +35 -0
  11. package/contract/generated/projjson-v0.7-crs-validator.d.ts.map +1 -0
  12. package/contract/generated/projjson-v0.7-crs-validator.js +3941 -0
  13. package/contract/index.d.ts +11 -2
  14. package/contract/index.d.ts.map +1 -1
  15. package/contract/index.js +4 -1
  16. package/contract/pmtiles.d.ts +31 -0
  17. package/contract/pmtiles.d.ts.map +1 -1
  18. package/contract/pmtiles.js +60 -20
  19. package/contract/protocol-module.d.ts +70 -0
  20. package/contract/protocol-module.d.ts.map +1 -0
  21. package/contract/protocol-module.js +1 -0
  22. package/contract/schema-envelope.d.ts +26 -0
  23. package/contract/schema-envelope.d.ts.map +1 -0
  24. package/contract/schema-envelope.js +25 -0
  25. package/contract/schema.d.ts +582 -0
  26. package/contract/schema.d.ts.map +1 -0
  27. package/contract/schema.js +2483 -0
  28. package/contract/source-capability-support.d.ts +6 -0
  29. package/contract/source-capability-support.d.ts.map +1 -0
  30. package/contract/source-capability-support.js +154 -0
  31. package/contract/source.d.ts +35 -17
  32. package/contract/source.d.ts.map +1 -1
  33. package/contract/source.js +267 -71
  34. package/contract/types.d.ts +140 -4
  35. package/contract/types.d.ts.map +1 -1
  36. package/contract/types.js +6 -14
  37. package/core/bounded-json.d.ts +4 -0
  38. package/core/bounded-json.d.ts.map +1 -0
  39. package/core/bounded-json.js +38 -0
  40. package/core/cache-state.d.ts +9 -0
  41. package/core/cache-state.d.ts.map +1 -1
  42. package/core/cache-state.js +10 -0
  43. package/core/capabilities-xml.d.ts +33 -0
  44. package/core/capabilities-xml.d.ts.map +1 -0
  45. package/core/capabilities-xml.js +331 -0
  46. package/core/client.d.ts +4 -1
  47. package/core/client.d.ts.map +1 -1
  48. package/core/client.js +115 -29
  49. package/core/error-classifications.d.ts +153 -0
  50. package/core/error-classifications.d.ts.map +1 -0
  51. package/core/error-classifications.js +140 -0
  52. package/core/error-code-registry.d.ts +158 -0
  53. package/core/error-code-registry.d.ts.map +1 -0
  54. package/core/error-code-registry.js +143 -0
  55. package/core/error-envelope.d.ts +68 -0
  56. package/core/error-envelope.d.ts.map +1 -0
  57. package/core/error-envelope.js +357 -0
  58. package/core/errors.d.ts +45 -29
  59. package/core/errors.d.ts.map +1 -1
  60. package/core/errors.js +97 -50
  61. package/core/geoparquet-sql.d.ts +30 -2
  62. package/core/geoparquet-sql.d.ts.map +1 -1
  63. package/core/geoparquet-sql.js +38 -3
  64. package/core/odata-key-path.d.ts +12 -0
  65. package/core/odata-key-path.d.ts.map +1 -0
  66. package/core/odata-key-path.js +28 -0
  67. package/core/odata-write-codec.d.ts +66 -0
  68. package/core/odata-write-codec.d.ts.map +1 -0
  69. package/core/odata-write-codec.js +1083 -0
  70. package/core/odata.d.ts +59 -7
  71. package/core/odata.d.ts.map +1 -1
  72. package/core/odata.js +431 -99
  73. package/core/ogc-features.d.ts.map +1 -1
  74. package/core/ogc-features.js +3 -0
  75. package/core/ogc-maps.d.ts +7 -0
  76. package/core/ogc-maps.d.ts.map +1 -1
  77. package/core/ogc-maps.js +46 -7
  78. package/core/ogc-processes.d.ts +2 -1
  79. package/core/ogc-processes.d.ts.map +1 -1
  80. package/core/ogc-processes.js +33 -5
  81. package/core/ogc-records.d.ts +9 -0
  82. package/core/ogc-records.d.ts.map +1 -1
  83. package/core/ogc-records.js +78 -29
  84. package/core/ogc-tiles.d.ts +10 -1
  85. package/core/ogc-tiles.d.ts.map +1 -1
  86. package/core/ogc-tiles.js +56 -17
  87. package/core/path-utils.d.ts +9 -0
  88. package/core/path-utils.d.ts.map +1 -1
  89. package/core/path-utils.js +19 -0
  90. package/core/protocol-transport.d.ts +1 -0
  91. package/core/protocol-transport.d.ts.map +1 -1
  92. package/core/request-pipeline.d.ts.map +1 -1
  93. package/core/request-pipeline.js +1 -1
  94. package/core/spatial-filter.d.ts +8 -4
  95. package/core/spatial-filter.d.ts.map +1 -1
  96. package/core/spatial-filter.js +206 -16
  97. package/core/stac-static.d.ts +6 -2
  98. package/core/stac-static.d.ts.map +1 -1
  99. package/core/stac-static.js +260 -69
  100. package/core/surfaces.d.ts.map +1 -1
  101. package/core/surfaces.js +69 -5
  102. package/core/types.d.ts +125 -7
  103. package/core/types.d.ts.map +1 -1
  104. package/core/wfs-capabilities.d.ts +2 -0
  105. package/core/wfs-capabilities.d.ts.map +1 -1
  106. package/core/wfs-capabilities.js +8 -1
  107. package/core/wfs.d.ts.map +1 -1
  108. package/core/wfs.js +10 -0
  109. package/core/wms-capabilities.d.ts +56 -84
  110. package/core/wms-capabilities.d.ts.map +1 -1
  111. package/core/wms-capabilities.js +212 -509
  112. package/core/wmts-capabilities.d.ts +62 -62
  113. package/core/wmts-capabilities.d.ts.map +1 -1
  114. package/core/wmts-capabilities.js +224 -371
  115. package/esri-compat/editor.d.ts +8 -0
  116. package/esri-compat/editor.d.ts.map +1 -1
  117. package/esri-compat/editor.js +13 -0
  118. package/esri-compat/feature-layer.d.ts +2 -0
  119. package/esri-compat/feature-layer.d.ts.map +1 -1
  120. package/esri-compat/feature-layer.js +1 -0
  121. package/esri-compat/layer-list.d.ts +11 -0
  122. package/esri-compat/layer-list.d.ts.map +1 -1
  123. package/esri-compat/layer-list.js +49 -0
  124. package/esri-compat/legend.d.ts +10 -0
  125. package/esri-compat/legend.d.ts.map +1 -1
  126. package/esri-compat/legend.js +27 -0
  127. package/esri-compat/portal.d.ts +197 -0
  128. package/esri-compat/portal.d.ts.map +1 -0
  129. package/esri-compat/portal.js +251 -0
  130. package/esri-compat/renderer-objects.d.ts +40 -0
  131. package/esri-compat/renderer-objects.d.ts.map +1 -0
  132. package/esri-compat/renderer-objects.js +62 -0
  133. package/esri-compat/sketch.d.ts +43 -0
  134. package/esri-compat/sketch.d.ts.map +1 -1
  135. package/esri-compat/sketch.js +46 -0
  136. package/esri-compat/snapping.d.ts +43 -0
  137. package/esri-compat/snapping.d.ts.map +1 -0
  138. package/esri-compat/snapping.js +45 -0
  139. package/esri-compat/url.d.ts.map +1 -1
  140. package/esri-compat/url.js +1 -1
  141. package/esri-compat/widget-host.d.ts +84 -0
  142. package/esri-compat/widget-host.d.ts.map +1 -0
  143. package/esri-compat/widget-host.js +159 -0
  144. package/filter-registry/index.d.ts +145 -0
  145. package/filter-registry/index.d.ts.map +1 -0
  146. package/filter-registry/index.js +531 -0
  147. package/generated-app/errors.d.ts +18 -2
  148. package/generated-app/errors.d.ts.map +1 -1
  149. package/generated-app/errors.js +44 -11
  150. package/map/automatic-mount-integration.d.ts +134 -0
  151. package/map/automatic-mount-integration.d.ts.map +1 -0
  152. package/map/automatic-mount-integration.js +305 -0
  153. package/map/automatic-source-strategy.d.ts +125 -0
  154. package/map/automatic-source-strategy.d.ts.map +1 -0
  155. package/map/automatic-source-strategy.js +494 -0
  156. package/map/data-to-map-bridge.d.ts +293 -0
  157. package/map/data-to-map-bridge.d.ts.map +1 -0
  158. package/map/data-to-map-bridge.js +817 -0
  159. package/map/geojson-projection.d.ts +33 -0
  160. package/map/geojson-projection.d.ts.map +1 -0
  161. package/map/geojson-projection.js +118 -0
  162. package/map/index.d.ts +14 -0
  163. package/map/index.d.ts.map +1 -1
  164. package/map/index.js +8 -0
  165. package/map/raster-source-spec.d.ts +30 -0
  166. package/map/raster-source-spec.d.ts.map +1 -0
  167. package/map/raster-source-spec.js +190 -0
  168. package/map/raster-source-strategy.d.ts +65 -0
  169. package/map/raster-source-strategy.d.ts.map +1 -0
  170. package/map/raster-source-strategy.js +232 -0
  171. package/map/source-to-maplibre.d.ts +91 -0
  172. package/map/source-to-maplibre.d.ts.map +1 -0
  173. package/map/source-to-maplibre.js +454 -0
  174. package/map/temporal-playback.d.ts +139 -0
  175. package/map/temporal-playback.d.ts.map +1 -0
  176. package/map/temporal-playback.js +247 -0
  177. package/package.json +14 -1
  178. package/query-planner/canonical.d.ts +7 -0
  179. package/query-planner/canonical.d.ts.map +1 -0
  180. package/query-planner/canonical.js +145 -0
  181. package/query-planner/cql2-json.d.ts +17 -0
  182. package/query-planner/cql2-json.d.ts.map +1 -0
  183. package/query-planner/cql2-json.js +646 -0
  184. package/query-planner/diagnostics.d.ts +35 -0
  185. package/query-planner/diagnostics.d.ts.map +1 -0
  186. package/query-planner/diagnostics.js +373 -0
  187. package/query-planner/duckdb.d.ts +79 -0
  188. package/query-planner/duckdb.d.ts.map +1 -0
  189. package/query-planner/duckdb.js +758 -0
  190. package/query-planner/execution-context.d.ts +5 -0
  191. package/query-planner/execution-context.d.ts.map +1 -0
  192. package/query-planner/execution-context.js +50 -0
  193. package/query-planner/executor.d.ts +5 -0
  194. package/query-planner/executor.d.ts.map +1 -0
  195. package/query-planner/executor.js +223 -0
  196. package/query-planner/geoservices.d.ts +91 -0
  197. package/query-planner/geoservices.d.ts.map +1 -0
  198. package/query-planner/geoservices.js +667 -0
  199. package/query-planner/grpc.d.ts +100 -0
  200. package/query-planner/grpc.d.ts.map +1 -0
  201. package/query-planner/grpc.js +736 -0
  202. package/query-planner/index.d.ts +44 -0
  203. package/query-planner/index.d.ts.map +1 -0
  204. package/query-planner/index.js +30 -0
  205. package/query-planner/ir.d.ts +20 -0
  206. package/query-planner/ir.d.ts.map +1 -0
  207. package/query-planner/ir.js +417 -0
  208. package/query-planner/local-aggregate.d.ts +5 -0
  209. package/query-planner/local-aggregate.d.ts.map +1 -0
  210. package/query-planner/local-aggregate.js +126 -0
  211. package/query-planner/odata.d.ts +48 -0
  212. package/query-planner/odata.d.ts.map +1 -0
  213. package/query-planner/odata.js +662 -0
  214. package/query-planner/ogc-compiler.d.ts +55 -0
  215. package/query-planner/ogc-compiler.d.ts.map +1 -0
  216. package/query-planner/ogc-compiler.js +480 -0
  217. package/query-planner/ogc-features.d.ts +53 -0
  218. package/query-planner/ogc-features.d.ts.map +1 -0
  219. package/query-planner/ogc-features.js +617 -0
  220. package/query-planner/planner.d.ts +17 -0
  221. package/query-planner/planner.d.ts.map +1 -0
  222. package/query-planner/planner.js +818 -0
  223. package/query-planner/resource.d.ts +94 -0
  224. package/query-planner/resource.d.ts.map +1 -0
  225. package/query-planner/resource.js +526 -0
  226. package/query-planner/semantic-canonical.d.ts +15 -0
  227. package/query-planner/semantic-canonical.d.ts.map +1 -0
  228. package/query-planner/semantic-canonical.js +62 -0
  229. package/query-planner/semantic-compat.d.ts +10 -0
  230. package/query-planner/semantic-compat.d.ts.map +1 -0
  231. package/query-planner/semantic-compat.js +35 -0
  232. package/query-planner/semantic-compiler.d.ts +64 -0
  233. package/query-planner/semantic-compiler.d.ts.map +1 -0
  234. package/query-planner/semantic-compiler.js +81 -0
  235. package/query-planner/semantic-literals.d.ts +30 -0
  236. package/query-planner/semantic-literals.d.ts.map +1 -0
  237. package/query-planner/semantic-literals.js +133 -0
  238. package/query-planner/semantic-types.d.ts +265 -0
  239. package/query-planner/semantic-types.d.ts.map +1 -0
  240. package/query-planner/semantic-types.js +1 -0
  241. package/query-planner/semantic.d.ts +54 -0
  242. package/query-planner/semantic.d.ts.map +1 -0
  243. package/query-planner/semantic.js +1421 -0
  244. package/query-planner/types.d.ts +560 -0
  245. package/query-planner/types.d.ts.map +1 -0
  246. package/query-planner/types.js +49 -0
  247. package/query-planner/wfs-semantic.d.ts +58 -0
  248. package/query-planner/wfs-semantic.d.ts.map +1 -0
  249. package/query-planner/wfs-semantic.js +547 -0
  250. package/query-planner/wfs.d.ts +6 -0
  251. package/query-planner/wfs.d.ts.map +1 -0
  252. package/query-planner/wfs.js +71 -0
  253. package/react/external-map.d.ts +67 -0
  254. package/react/external-map.d.ts.map +1 -0
  255. package/react/external-map.js +63 -0
  256. package/react/honua-map.d.ts.map +1 -1
  257. package/react/honua-map.js +3 -2
  258. package/react/honua-source-layer.d.ts +110 -0
  259. package/react/honua-source-layer.d.ts.map +1 -0
  260. package/react/honua-source-layer.js +101 -0
  261. package/react/hooks.d.ts +28 -0
  262. package/react/hooks.d.ts.map +1 -1
  263. package/react/hooks.js +26 -4
  264. package/react/index.d.ts +8 -0
  265. package/react/index.d.ts.map +1 -1
  266. package/react/index.js +5 -0
  267. package/react/query-cache.d.ts +26 -4
  268. package/react/query-cache.d.ts.map +1 -1
  269. package/react/query-cache.js +51 -8
  270. package/react/selection.d.ts +177 -0
  271. package/react/selection.d.ts.map +1 -0
  272. package/react/selection.js +0 -0
  273. package/react/use-mounted-source.d.ts +69 -0
  274. package/react/use-mounted-source.d.ts.map +1 -0
  275. package/react/use-mounted-source.js +346 -0
  276. package/runtime/edit-snapping.d.ts +107 -0
  277. package/runtime/edit-snapping.d.ts.map +1 -0
  278. package/runtime/edit-snapping.js +190 -0
  279. package/runtime/errors.d.ts +3 -2
  280. package/runtime/errors.d.ts.map +1 -1
  281. package/runtime/errors.js +19 -2
  282. package/runtime/index.d.ts +6 -0
  283. package/runtime/index.d.ts.map +1 -1
  284. package/runtime/index.js +3 -0
  285. package/runtime/maplibre-renderer.d.ts +41 -0
  286. package/runtime/maplibre-renderer.d.ts.map +1 -0
  287. package/runtime/maplibre-renderer.js +322 -0
  288. package/runtime/query-tiles.d.ts +2 -1
  289. package/runtime/query-tiles.d.ts.map +1 -1
  290. package/runtime/query-tiles.js +6 -2
  291. package/runtime/source-bridge.d.ts +4 -4
  292. package/runtime/source-bridge.d.ts.map +1 -1
  293. package/runtime/source-bridge.js +9 -56
  294. package/runtime/style-interactions.d.ts +3 -2
  295. package/runtime/style-interactions.d.ts.map +1 -1
  296. package/runtime/style-interactions.js +11 -3
  297. package/runtime/terra-draw-sketch.d.ts +275 -0
  298. package/runtime/terra-draw-sketch.d.ts.map +1 -0
  299. package/runtime/terra-draw-sketch.js +404 -0
  300. package/source-capability-registry.d.ts +1 -0
  301. package/source-capability-registry.js +1 -0
  302. package/source-capability-types.d.ts +186 -0
  303. package/source-capability-types.js +7 -0
  304. package/style/index.d.ts +2 -0
  305. package/style/index.d.ts.map +1 -1
  306. package/style/index.js +2 -0
  307. package/style/renderers.d.ts +326 -0
  308. package/style/renderers.d.ts.map +1 -0
  309. package/style/renderers.js +517 -0
  310. package/webmap/convert-renderer.d.ts +24 -3
  311. package/webmap/convert-renderer.d.ts.map +1 -1
  312. package/webmap/convert-renderer.js +93 -112
  313. package/webmap/index.d.ts +1 -1
  314. package/webmap/index.d.ts.map +1 -1
  315. package/webmap/index.js +1 -1
@@ -0,0 +1,160 @@
1
+ /**
2
+ * Renderer-neutral snapping for edit-sketch workflows.
3
+ *
4
+ * The engine resolves a pointer position (screen space plus a caller-provided
5
+ * projection function) against a {@link SnapIndex} of loaded features and
6
+ * returns the nearest snap candidate with deterministic ordering:
7
+ *
8
+ * 1. smallest screen distance wins;
9
+ * 2. at equal distance, `vertex` beats `edge` beats `feature`;
10
+ * 3. remaining ties break by source id, then feature id, then vertex /
11
+ * segment ordinal.
12
+ *
13
+ * The index is a packed uniform grid over feature vertices, segments, and
14
+ * polygon bodies — no per-move full scans and no new runtime dependency.
15
+ * Geometry is GeoJSON-shaped (`Point`, `MultiPoint`, `LineString`,
16
+ * `MultiLineString`, `Polygon`, `MultiPolygon`, `GeometryCollection`).
17
+ *
18
+ * @module
19
+ */
20
+ import type { EditWorkflowOptimisticHooks } from "./edit-session.js";
21
+ import type { FeatureId } from "./types.js";
22
+ export type SnapCandidateKind = "vertex" | "edge" | "feature";
23
+ /** A point in renderer screen space (CSS pixels). */
24
+ export interface SnapScreenPoint {
25
+ readonly x: number;
26
+ readonly y: number;
27
+ }
28
+ /** A geographic (or planar) coordinate as `[x, y]` / `[lng, lat]`. */
29
+ export type SnapPosition = readonly [number, number];
30
+ /** Projects a geographic position into screen space. */
31
+ export type SnapProjection = (position: SnapPosition) => SnapScreenPoint;
32
+ /** Per-source snapping overrides inside {@link SnappingConfig.sources}. */
33
+ export interface SnapSourceOptions {
34
+ /** Disable the source entirely. @default true */
35
+ enabled?: boolean;
36
+ /** Candidate kinds for this source; overrides {@link SnappingConfig.kinds}. */
37
+ kinds?: readonly SnapCandidateKind[];
38
+ }
39
+ export interface SnappingConfig {
40
+ /** Master switch. */
41
+ enabled: boolean;
42
+ /** Snap tolerance in screen pixels (candidates at exactly the tolerance still snap). */
43
+ tolerance: number;
44
+ /**
45
+ * Candidate kinds resolved by default. `feature` adds whole-feature
46
+ * (feature-body) candidates: inside a polygon the pointer itself is a
47
+ * zero-distance candidate; otherwise the nearest point on the feature.
48
+ */
49
+ kinds: readonly SnapCandidateKind[];
50
+ /**
51
+ * Per-source enablement keyed by source id. Missing sources default to
52
+ * enabled with the global `kinds`. `false` disables a source.
53
+ */
54
+ sources: Readonly<Record<string, boolean | SnapSourceOptions>>;
55
+ }
56
+ export declare const DEFAULT_SNAPPING_CONFIG: SnappingConfig;
57
+ /** Merge a partial config over {@link DEFAULT_SNAPPING_CONFIG}. */
58
+ export declare function resolveSnappingConfig(input?: Partial<SnappingConfig>): SnappingConfig;
59
+ export interface SnapCandidate {
60
+ kind: SnapCandidateKind;
61
+ sourceId: string;
62
+ featureId: FeatureId;
63
+ /** Geographic position of the snap target. */
64
+ position: SnapPosition;
65
+ /** Screen-space position of the snap target. */
66
+ screenPoint: SnapScreenPoint;
67
+ /** Screen-space distance from the pointer, in pixels. */
68
+ distance: number;
69
+ /** Ordinal of the snapped vertex within the feature (vertex candidates). */
70
+ vertexIndex?: number;
71
+ /** Ordinal of the snapped segment within the feature (edge candidates). */
72
+ segmentIndex?: number;
73
+ }
74
+ export interface SnapQueryInput {
75
+ /** Pointer position in screen space. */
76
+ point: SnapScreenPoint;
77
+ /** Pointer position in geographic space. */
78
+ position: SnapPosition;
79
+ /** Projection from geographic space to screen space. */
80
+ project: SnapProjection;
81
+ }
82
+ export interface SnapResolution {
83
+ snapped: boolean;
84
+ /** Best candidate under deterministic ordering, when snapped. */
85
+ candidate?: SnapCandidate;
86
+ /** All candidates within tolerance, deterministically sorted. */
87
+ candidates: readonly SnapCandidate[];
88
+ }
89
+ export declare function compareSnapCandidates(a: SnapCandidate, b: SnapCandidate): number;
90
+ /** Feature input for the snap index. Geometry is GeoJSON-shaped. */
91
+ export interface SnapIndexFeatureInput {
92
+ id: FeatureId;
93
+ geometry: Record<string, unknown> | null | undefined;
94
+ }
95
+ export interface SnapIndexStats {
96
+ sourceCount: number;
97
+ featureCount: number;
98
+ vertexCount: number;
99
+ segmentCount: number;
100
+ /** Number of grid rebuilds performed so far (increments after invalidation). */
101
+ gridBuilds: number;
102
+ }
103
+ /**
104
+ * Uniform packed-grid spatial index over snap sources.
105
+ *
106
+ * Mutations mark the grid dirty; it is rebuilt lazily on the next query.
107
+ * Feature geometries are treated as immutable once handed to the index.
108
+ */
109
+ export declare class SnapIndex {
110
+ #private;
111
+ /** Replace every indexed feature for a source. */
112
+ setSourceFeatures(sourceId: string, features: readonly SnapIndexFeatureInput[]): void;
113
+ /**
114
+ * Insert or replace a single feature. Returns the previous feature input
115
+ * (id + geometry) when one was indexed, so optimistic edits can restore it.
116
+ */
117
+ upsertFeature(sourceId: string, feature: SnapIndexFeatureInput): SnapIndexFeatureInput | undefined;
118
+ /** Remove a single feature. Returns the removed feature input, if any. */
119
+ removeFeature(sourceId: string, featureId: FeatureId): SnapIndexFeatureInput | undefined;
120
+ removeSource(sourceId: string): void;
121
+ clear(): void;
122
+ /** Force a lazy grid rebuild on the next query (e.g. after realtime updates). */
123
+ invalidate(): void;
124
+ sourceIds(): readonly string[];
125
+ stats(): SnapIndexStats;
126
+ /**
127
+ * Resolve a pointer against this index. See {@link resolveSnapCandidate}
128
+ * for the deterministic ordering contract.
129
+ */
130
+ resolve(input: SnapQueryInput, config?: Partial<SnappingConfig>): SnapResolution;
131
+ }
132
+ export declare function createSnapIndex(): SnapIndex;
133
+ /**
134
+ * Resolve the pointer against the index and return the nearest snap candidate
135
+ * under the deterministic ordering documented on this module.
136
+ */
137
+ export declare function resolveSnapCandidate(index: SnapIndex, input: SnapQueryInput, config?: Partial<SnappingConfig>): SnapResolution;
138
+ /**
139
+ * Return `geometry` with its active sketch vertex replaced by `position`.
140
+ *
141
+ * The active vertex is the last drawn coordinate: the point itself for
142
+ * `Point`, the final coordinate for `MultiPoint` / `LineString` /
143
+ * `MultiLineString`, and the final non-closing vertex of the last ring for
144
+ * `Polygon` / `MultiPolygon` (ring closure is preserved). Unknown geometry
145
+ * shapes are returned unchanged.
146
+ */
147
+ export declare function withSnappedActiveVertex(geometry: Record<string, unknown> | null, position: SnapPosition): Record<string, unknown> | null;
148
+ export interface SnapIndexEditSessionHookOptions<T = Record<string, unknown>> {
149
+ /** Hooks to compose with; index maintenance runs before delegation. */
150
+ inner?: EditWorkflowOptimisticHooks<T>;
151
+ }
152
+ /**
153
+ * Optimistic edit-session hooks that keep a {@link SnapIndex} in sync with
154
+ * an edit workflow's lifecycle: `apply` upserts (or removes, for deletes)
155
+ * the edited feature, `rollback` restores the pre-edit index entry, and
156
+ * `commit` finalizes it. Pass the result as the `optimistic` option of
157
+ * `createEditSession` / `createEditSketchWorkflow`.
158
+ */
159
+ export declare function createSnapIndexEditSessionHooks<T = Record<string, unknown>>(index: SnapIndex, options?: SnapIndexEditSessionHookOptions<T>): EditWorkflowOptimisticHooks<T>;
160
+ //# sourceMappingURL=edit-snapping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-snapping.d.ts","sourceRoot":"","sources":["../../../src/contract/edit-snapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAkD,MAAM,mBAAmB,CAAC;AACrH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC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