geo-polygonize 0.54.0 → 0.56.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 (83) hide show
  1. package/dist/geo_polygonize.wasm +0 -0
  2. package/dist/geo_polygonize_simd.wasm +0 -0
  3. package/dist/slim/cjs/bindings/CoordinateFingerprintV1.d.ts +8 -0
  4. package/dist/slim/cjs/bindings/ErrorWitnessV1.d.ts +5 -0
  5. package/dist/slim/cjs/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  6. package/dist/slim/cjs/bindings/PolygonFingerprintV1.d.ts +12 -0
  7. package/dist/slim/cjs/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  8. package/dist/slim/cjs/bindings/RingFingerprintV1.d.ts +5 -0
  9. package/dist/slim/cjs/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  10. package/dist/slim/cjs/bindings/TopologyFingerprintV1.d.ts +18 -0
  11. package/dist/slim/cjs/index.d.ts +2 -0
  12. package/dist/slim/cjs/index_slim.js +35 -3
  13. package/dist/slim/es/bindings/CoordinateFingerprintV1.d.ts +8 -0
  14. package/dist/slim/es/bindings/ErrorWitnessV1.d.ts +5 -0
  15. package/dist/slim/es/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  16. package/dist/slim/es/bindings/PolygonFingerprintV1.d.ts +12 -0
  17. package/dist/slim/es/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  18. package/dist/slim/es/bindings/RingFingerprintV1.d.ts +5 -0
  19. package/dist/slim/es/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  20. package/dist/slim/es/bindings/TopologyFingerprintV1.d.ts +18 -0
  21. package/dist/slim/es/index.d.ts +2 -0
  22. package/dist/slim/es/index_slim.js +35 -4
  23. package/dist/slim/pkg-scalar/geo_polygonize.d.ts +12 -3
  24. package/dist/slim/pkg-scalar/geo_polygonize_bg.wasm.d.ts +1 -0
  25. package/dist/slim/pkg-wrapper/bindings/CoordinateFingerprintV1.d.ts +8 -0
  26. package/dist/slim/pkg-wrapper/bindings/ErrorWitnessV1.d.ts +5 -0
  27. package/dist/slim/pkg-wrapper/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  28. package/dist/slim/pkg-wrapper/bindings/PolygonFingerprintV1.d.ts +12 -0
  29. package/dist/slim/pkg-wrapper/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  30. package/dist/slim/pkg-wrapper/bindings/RingFingerprintV1.d.ts +5 -0
  31. package/dist/slim/pkg-wrapper/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  32. package/dist/slim/pkg-wrapper/bindings/TopologyFingerprintV1.d.ts +18 -0
  33. package/dist/standard/cjs/bindings/CoordinateFingerprintV1.d.ts +8 -0
  34. package/dist/standard/cjs/bindings/ErrorWitnessV1.d.ts +5 -0
  35. package/dist/standard/cjs/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  36. package/dist/standard/cjs/bindings/PolygonFingerprintV1.d.ts +12 -0
  37. package/dist/standard/cjs/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  38. package/dist/standard/cjs/bindings/RingFingerprintV1.d.ts +5 -0
  39. package/dist/standard/cjs/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  40. package/dist/standard/cjs/bindings/TopologyFingerprintV1.d.ts +18 -0
  41. package/dist/standard/cjs/index.d.ts +2 -0
  42. package/dist/standard/cjs/index.js +37 -5
  43. package/dist/standard/es/bindings/CoordinateFingerprintV1.d.ts +8 -0
  44. package/dist/standard/es/bindings/ErrorWitnessV1.d.ts +5 -0
  45. package/dist/standard/es/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  46. package/dist/standard/es/bindings/PolygonFingerprintV1.d.ts +12 -0
  47. package/dist/standard/es/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  48. package/dist/standard/es/bindings/RingFingerprintV1.d.ts +5 -0
  49. package/dist/standard/es/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  50. package/dist/standard/es/bindings/TopologyFingerprintV1.d.ts +18 -0
  51. package/dist/standard/es/index.d.ts +2 -0
  52. package/dist/standard/es/index.js +37 -6
  53. package/dist/standard/pkg-scalar/geo_polygonize.d.ts +12 -3
  54. package/dist/standard/pkg-scalar/geo_polygonize_bg.wasm.d.ts +1 -0
  55. package/dist/standard/pkg-wrapper/bindings/CoordinateFingerprintV1.d.ts +8 -0
  56. package/dist/standard/pkg-wrapper/bindings/ErrorWitnessV1.d.ts +5 -0
  57. package/dist/standard/pkg-wrapper/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  58. package/dist/standard/pkg-wrapper/bindings/PolygonFingerprintV1.d.ts +12 -0
  59. package/dist/standard/pkg-wrapper/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  60. package/dist/standard/pkg-wrapper/bindings/RingFingerprintV1.d.ts +5 -0
  61. package/dist/standard/pkg-wrapper/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  62. package/dist/standard/pkg-wrapper/bindings/TopologyFingerprintV1.d.ts +18 -0
  63. package/dist/threads/es/bindings/CoordinateFingerprintV1.d.ts +8 -0
  64. package/dist/threads/es/bindings/ErrorWitnessV1.d.ts +5 -0
  65. package/dist/threads/es/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  66. package/dist/threads/es/bindings/PolygonFingerprintV1.d.ts +12 -0
  67. package/dist/threads/es/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  68. package/dist/threads/es/bindings/RingFingerprintV1.d.ts +5 -0
  69. package/dist/threads/es/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  70. package/dist/threads/es/bindings/TopologyFingerprintV1.d.ts +18 -0
  71. package/dist/threads/es/index.d.ts +2 -0
  72. package/dist/threads/es/index.js +35 -4
  73. package/dist/threads/pkg-threads/geo_polygonize.d.ts +12 -3
  74. package/dist/threads/pkg-threads/geo_polygonize_bg.wasm.d.ts +1 -0
  75. package/dist/threads/pkg-wrapper/bindings/CoordinateFingerprintV1.d.ts +8 -0
  76. package/dist/threads/pkg-wrapper/bindings/ErrorWitnessV1.d.ts +5 -0
  77. package/dist/threads/pkg-wrapper/bindings/NormalizedPolygonizeErrorV1.d.ts +16 -0
  78. package/dist/threads/pkg-wrapper/bindings/PolygonFingerprintV1.d.ts +12 -0
  79. package/dist/threads/pkg-wrapper/bindings/ProvenanceFingerprintV1.d.ts +7 -0
  80. package/dist/threads/pkg-wrapper/bindings/RingFingerprintV1.d.ts +5 -0
  81. package/dist/threads/pkg-wrapper/bindings/TopologyDiagnosticsFingerprintV1.d.ts +15 -0
  82. package/dist/threads/pkg-wrapper/bindings/TopologyFingerprintV1.d.ts +18 -0
  83. package/package.json +1 -1
Binary file
Binary file
@@ -0,0 +1,8 @@
1
+ /**
2
+ * An exact finite coordinate. Every component is an IEEE-754 bit pattern.
3
+ */
4
+ export type CoordinateFingerprintV1 = {
5
+ x: string;
6
+ y: string;
7
+ z: string;
8
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type ErrorWitnessV1 = {
3
+ ids: Array<string>;
4
+ coordinate: CoordinateFingerprintV1 | null;
5
+ };
@@ -0,0 +1,16 @@
1
+ import type { ErrorWitnessV1 } from "./ErrorWitnessV1";
2
+ /**
3
+ * A structured, stable error equality contract.
4
+ */
5
+ export type NormalizedPolygonizeErrorV1 = {
6
+ schema_version: number;
7
+ family: string;
8
+ code: string;
9
+ stage: string;
10
+ field: string | null;
11
+ expected: string | null;
12
+ actual: string | null;
13
+ limit: string | null;
14
+ observed: string | null;
15
+ witness: ErrorWitnessV1 | null;
16
+ };
@@ -0,0 +1,12 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { ProvenanceFingerprintV1 } from "./ProvenanceFingerprintV1";
3
+ import type { RingFingerprintV1 } from "./RingFingerprintV1";
4
+ export type PolygonFingerprintV1 = {
5
+ exterior: Array<CoordinateFingerprintV1>;
6
+ interiors: Array<RingFingerprintV1>;
7
+ /**
8
+ * Per-edge representative input IDs, encoded as fixed-width hex strings.
9
+ */
10
+ exterior_edge_ids: Array<string>;
11
+ provenance: ProvenanceFingerprintV1 | null;
12
+ };
@@ -0,0 +1,7 @@
1
+ export type ProvenanceFingerprintV1 = {
2
+ /**
3
+ * Complete source sets, never JSON numbers, so JavaScript cannot lose IDs.
4
+ */
5
+ boundary_line_ids: Array<string>;
6
+ input_profile_id: string | null;
7
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type RingFingerprintV1 = {
3
+ coordinates: Array<CoordinateFingerprintV1>;
4
+ edge_ids: Array<string>;
5
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Only topology-level diagnostics. Timings and work counters are deliberately excluded.
3
+ */
4
+ export type TopologyDiagnosticsFingerprintV1 = {
5
+ dangle_count: number;
6
+ cut_edge_count: number;
7
+ ring_count: number;
8
+ shell_count: number;
9
+ hole_count: number;
10
+ unassigned_hole_count: number;
11
+ unassigned_hole_area: string;
12
+ invalid_ring_count: number;
13
+ z_conflict_node_count: number;
14
+ z_conflicting_line_ids: Array<string>;
15
+ };
@@ -0,0 +1,18 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { PolygonFingerprintV1 } from "./PolygonFingerprintV1";
3
+ import type { TopologyDiagnosticsFingerprintV1 } from "./TopologyDiagnosticsFingerprintV1";
4
+ /**
5
+ * A versioned, structured canonical representation of a successful run.
6
+ */
7
+ export type TopologyFingerprintV1 = {
8
+ schema_version: number;
9
+ /**
10
+ * The serialized canonical options object is part of the semantic contract.
11
+ */
12
+ options: unknown;
13
+ polygons: Array<PolygonFingerprintV1>;
14
+ dangles: Array<Array<CoordinateFingerprintV1>>;
15
+ cut_edges: Array<Array<CoordinateFingerprintV1>>;
16
+ invalid_rings: Array<Array<CoordinateFingerprintV1>>;
17
+ diagnostics: TopologyDiagnosticsFingerprintV1 | null;
18
+ };
@@ -15,5 +15,7 @@ export * from "./bindings/TileOwnershipPolicy";
15
15
  export * from "./bindings/TouchPolicy";
16
16
  export * from "./bindings/ZOptions";
17
17
  export * from "./bindings/ZPolicy";
18
+ export * from "./bindings/TopologyFingerprintV1";
19
+ export * from "./bindings/NormalizedPolygonizeErrorV1";
18
20
  export * from "./cfb";
19
21
  export default function init(_input?: any): Promise<typeof exports>;
@@ -272,12 +272,42 @@ function polygonizeGeoArrowWithOptions(ipc_bytes, options_val) {
272
272
  return v2;
273
273
  }
274
274
 
275
+ /**
276
+ * Returns the complete versioned topology report for a GeoJSON canonical-options call.
277
+ *
278
+ * The report is the JSON serialization of `TopologyFingerprintV1`; it is the
279
+ * stable cross-binding success contract, not a polygon-only GeoJSON projection.
280
+ * @param {string} geojson_str
281
+ * @param {any} options_val
282
+ * @returns {string}
283
+ */
284
+ function polygonizeReportWithOptions(geojson_str, options_val) {
285
+ let deferred3_0;
286
+ let deferred3_1;
287
+ try {
288
+ const ptr0 = passStringToWasm0(geojson_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
289
+ const len0 = WASM_VECTOR_LEN;
290
+ const ret = wasm.polygonizeReportWithOptions(ptr0, len0, options_val);
291
+ var ptr2 = ret[0];
292
+ var len2 = ret[1];
293
+ if (ret[3]) {
294
+ ptr2 = 0; len2 = 0;
295
+ throw takeFromExternrefTable0(ret[2]);
296
+ }
297
+ deferred3_0 = ptr2;
298
+ deferred3_1 = len2;
299
+ return getStringFromWasm0(ptr2, len2);
300
+ } finally {
301
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
302
+ }
303
+ }
304
+
275
305
  /**
276
306
  * Polygonizes a GeoJSON FeatureCollection using the canonical `PolygonizerOptions`.
277
307
  *
278
- * This is the primary entry point for JavaScript users. It accepts a JSON string
279
- * of options and returns a JSON string representing the result, including faces,
280
- * dangles, cut-lines, and (optionally) provenance/diagnostics.
308
+ * This compatibility entry point returns polygons only. Use
309
+ * [`polygonize_report_with_options_js`] when dangles, cut edges, invalid rings,
310
+ * provenance, diagnostics, and exact coordinate encoding are required.
281
311
  * @param {string} geojson_str
282
312
  * @param {any} options_val
283
313
  * @returns {string}
@@ -985,6 +1015,7 @@ var scalarExports = /*#__PURE__*/Object.freeze({
985
1015
  polygonize: polygonize,
986
1016
  polygonizeFingerprintWithOptions: polygonizeFingerprintWithOptions,
987
1017
  polygonizeGeoArrowWithOptions: polygonizeGeoArrowWithOptions,
1018
+ polygonizeReportWithOptions: polygonizeReportWithOptions,
988
1019
  polygonizeWithOptions: polygonizeWithOptions,
989
1020
  polygonizeWithOptionsBuffer: polygonizeWithOptionsBuffer,
990
1021
  polygonize_buffers: polygonize_buffers,
@@ -1058,6 +1089,7 @@ exports.initSync = initSync;
1058
1089
  exports.polygonize = polygonize;
1059
1090
  exports.polygonizeFingerprintWithOptions = polygonizeFingerprintWithOptions;
1060
1091
  exports.polygonizeGeoArrowWithOptions = polygonizeGeoArrowWithOptions;
1092
+ exports.polygonizeReportWithOptions = polygonizeReportWithOptions;
1061
1093
  exports.polygonizeWithOptions = polygonizeWithOptions;
1062
1094
  exports.polygonizeWithOptionsBuffer = polygonizeWithOptionsBuffer;
1063
1095
  exports.polygonize_buffers = polygonize_buffers;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * An exact finite coordinate. Every component is an IEEE-754 bit pattern.
3
+ */
4
+ export type CoordinateFingerprintV1 = {
5
+ x: string;
6
+ y: string;
7
+ z: string;
8
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type ErrorWitnessV1 = {
3
+ ids: Array<string>;
4
+ coordinate: CoordinateFingerprintV1 | null;
5
+ };
@@ -0,0 +1,16 @@
1
+ import type { ErrorWitnessV1 } from "./ErrorWitnessV1";
2
+ /**
3
+ * A structured, stable error equality contract.
4
+ */
5
+ export type NormalizedPolygonizeErrorV1 = {
6
+ schema_version: number;
7
+ family: string;
8
+ code: string;
9
+ stage: string;
10
+ field: string | null;
11
+ expected: string | null;
12
+ actual: string | null;
13
+ limit: string | null;
14
+ observed: string | null;
15
+ witness: ErrorWitnessV1 | null;
16
+ };
@@ -0,0 +1,12 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { ProvenanceFingerprintV1 } from "./ProvenanceFingerprintV1";
3
+ import type { RingFingerprintV1 } from "./RingFingerprintV1";
4
+ export type PolygonFingerprintV1 = {
5
+ exterior: Array<CoordinateFingerprintV1>;
6
+ interiors: Array<RingFingerprintV1>;
7
+ /**
8
+ * Per-edge representative input IDs, encoded as fixed-width hex strings.
9
+ */
10
+ exterior_edge_ids: Array<string>;
11
+ provenance: ProvenanceFingerprintV1 | null;
12
+ };
@@ -0,0 +1,7 @@
1
+ export type ProvenanceFingerprintV1 = {
2
+ /**
3
+ * Complete source sets, never JSON numbers, so JavaScript cannot lose IDs.
4
+ */
5
+ boundary_line_ids: Array<string>;
6
+ input_profile_id: string | null;
7
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type RingFingerprintV1 = {
3
+ coordinates: Array<CoordinateFingerprintV1>;
4
+ edge_ids: Array<string>;
5
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Only topology-level diagnostics. Timings and work counters are deliberately excluded.
3
+ */
4
+ export type TopologyDiagnosticsFingerprintV1 = {
5
+ dangle_count: number;
6
+ cut_edge_count: number;
7
+ ring_count: number;
8
+ shell_count: number;
9
+ hole_count: number;
10
+ unassigned_hole_count: number;
11
+ unassigned_hole_area: string;
12
+ invalid_ring_count: number;
13
+ z_conflict_node_count: number;
14
+ z_conflicting_line_ids: Array<string>;
15
+ };
@@ -0,0 +1,18 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { PolygonFingerprintV1 } from "./PolygonFingerprintV1";
3
+ import type { TopologyDiagnosticsFingerprintV1 } from "./TopologyDiagnosticsFingerprintV1";
4
+ /**
5
+ * A versioned, structured canonical representation of a successful run.
6
+ */
7
+ export type TopologyFingerprintV1 = {
8
+ schema_version: number;
9
+ /**
10
+ * The serialized canonical options object is part of the semantic contract.
11
+ */
12
+ options: unknown;
13
+ polygons: Array<PolygonFingerprintV1>;
14
+ dangles: Array<Array<CoordinateFingerprintV1>>;
15
+ cut_edges: Array<Array<CoordinateFingerprintV1>>;
16
+ invalid_rings: Array<Array<CoordinateFingerprintV1>>;
17
+ diagnostics: TopologyDiagnosticsFingerprintV1 | null;
18
+ };
@@ -15,5 +15,7 @@ export * from "./bindings/TileOwnershipPolicy";
15
15
  export * from "./bindings/TouchPolicy";
16
16
  export * from "./bindings/ZOptions";
17
17
  export * from "./bindings/ZPolicy";
18
+ export * from "./bindings/TopologyFingerprintV1";
19
+ export * from "./bindings/NormalizedPolygonizeErrorV1";
18
20
  export * from "./cfb";
19
21
  export default function init(_input?: any): Promise<typeof exports>;
@@ -269,12 +269,42 @@ function polygonizeGeoArrowWithOptions(ipc_bytes, options_val) {
269
269
  return v2;
270
270
  }
271
271
 
272
+ /**
273
+ * Returns the complete versioned topology report for a GeoJSON canonical-options call.
274
+ *
275
+ * The report is the JSON serialization of `TopologyFingerprintV1`; it is the
276
+ * stable cross-binding success contract, not a polygon-only GeoJSON projection.
277
+ * @param {string} geojson_str
278
+ * @param {any} options_val
279
+ * @returns {string}
280
+ */
281
+ function polygonizeReportWithOptions(geojson_str, options_val) {
282
+ let deferred3_0;
283
+ let deferred3_1;
284
+ try {
285
+ const ptr0 = passStringToWasm0(geojson_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
286
+ const len0 = WASM_VECTOR_LEN;
287
+ const ret = wasm.polygonizeReportWithOptions(ptr0, len0, options_val);
288
+ var ptr2 = ret[0];
289
+ var len2 = ret[1];
290
+ if (ret[3]) {
291
+ ptr2 = 0; len2 = 0;
292
+ throw takeFromExternrefTable0(ret[2]);
293
+ }
294
+ deferred3_0 = ptr2;
295
+ deferred3_1 = len2;
296
+ return getStringFromWasm0(ptr2, len2);
297
+ } finally {
298
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
299
+ }
300
+ }
301
+
272
302
  /**
273
303
  * Polygonizes a GeoJSON FeatureCollection using the canonical `PolygonizerOptions`.
274
304
  *
275
- * This is the primary entry point for JavaScript users. It accepts a JSON string
276
- * of options and returns a JSON string representing the result, including faces,
277
- * dangles, cut-lines, and (optionally) provenance/diagnostics.
305
+ * This compatibility entry point returns polygons only. Use
306
+ * [`polygonize_report_with_options_js`] when dangles, cut edges, invalid rings,
307
+ * provenance, diagnostics, and exact coordinate encoding are required.
278
308
  * @param {string} geojson_str
279
309
  * @param {any} options_val
280
310
  * @returns {string}
@@ -982,6 +1012,7 @@ var scalarExports = /*#__PURE__*/Object.freeze({
982
1012
  polygonize: polygonize,
983
1013
  polygonizeFingerprintWithOptions: polygonizeFingerprintWithOptions,
984
1014
  polygonizeGeoArrowWithOptions: polygonizeGeoArrowWithOptions,
1015
+ polygonizeReportWithOptions: polygonizeReportWithOptions,
985
1016
  polygonizeWithOptions: polygonizeWithOptions,
986
1017
  polygonizeWithOptionsBuffer: polygonizeWithOptionsBuffer,
987
1018
  polygonize_buffers: polygonize_buffers,
@@ -1047,4 +1078,4 @@ async function initBest(scalarModule, simdModule) {
1047
1078
  return scalarExports;
1048
1079
  }
1049
1080
 
1050
- export { PolygonizerWasmError, WasmPolygonResult, cfbRobustOptions, initBest, initSync, polygonize, polygonizeFingerprintWithOptions, polygonizeGeoArrowWithOptions, polygonizeWithOptions, polygonizeWithOptionsBuffer, polygonize_buffers, polygonize_geoarrow };
1081
+ export { PolygonizerWasmError, WasmPolygonResult, cfbRobustOptions, initBest, initSync, polygonize, polygonizeFingerprintWithOptions, polygonizeGeoArrowWithOptions, polygonizeReportWithOptions, polygonizeWithOptions, polygonizeWithOptionsBuffer, polygonize_buffers, polygonize_geoarrow };
@@ -47,12 +47,20 @@ export function polygonizeFingerprintWithOptions(geojson_str: string, options_va
47
47
  */
48
48
  export function polygonizeGeoArrowWithOptions(ipc_bytes: Uint8Array, options_val: Partial<PolygonizerOptions>): Uint8Array;
49
49
 
50
+ /**
51
+ * Returns the complete versioned topology report for a GeoJSON canonical-options call.
52
+ *
53
+ * The report is the JSON serialization of `TopologyFingerprintV1`; it is the
54
+ * stable cross-binding success contract, not a polygon-only GeoJSON projection.
55
+ */
56
+ export function polygonizeReportWithOptions(geojson_str: string, options_val: Partial<PolygonizerOptions>): string;
57
+
50
58
  /**
51
59
  * Polygonizes a GeoJSON FeatureCollection using the canonical `PolygonizerOptions`.
52
60
  *
53
- * This is the primary entry point for JavaScript users. It accepts a JSON string
54
- * of options and returns a JSON string representing the result, including faces,
55
- * dangles, cut-lines, and (optionally) provenance/diagnostics.
61
+ * This compatibility entry point returns polygons only. Use
62
+ * [`polygonize_report_with_options_js`] when dangles, cut edges, invalid rings,
63
+ * provenance, diagnostics, and exact coordinate encoding are required.
56
64
  */
57
65
  export function polygonizeWithOptions(geojson_str: string, options_val: Partial<PolygonizerOptions>): string;
58
66
 
@@ -71,6 +79,7 @@ export interface InitOutput {
71
79
  readonly polygonize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
72
80
  readonly polygonizeFingerprintWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
73
81
  readonly polygonizeGeoArrowWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
82
+ readonly polygonizeReportWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
74
83
  readonly polygonizeWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
75
84
  readonly polygonizeWithOptionsBuffer: (a: number, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => [number, number, number];
76
85
  readonly polygonize_buffers: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
@@ -6,6 +6,7 @@ export const __wbg_wasmpolygonresult_free: (a: number, b: number) => void;
6
6
  export const polygonize: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
7
7
  export const polygonizeFingerprintWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
8
8
  export const polygonizeGeoArrowWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
9
+ export const polygonizeReportWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
9
10
  export const polygonizeWithOptions: (a: number, b: number, c: any) => [number, number, number, number];
10
11
  export const polygonizeWithOptionsBuffer: (a: number, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => [number, number, number];
11
12
  export const polygonize_buffers: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => [number, number, number];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * An exact finite coordinate. Every component is an IEEE-754 bit pattern.
3
+ */
4
+ export type CoordinateFingerprintV1 = {
5
+ x: string;
6
+ y: string;
7
+ z: string;
8
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type ErrorWitnessV1 = {
3
+ ids: Array<string>;
4
+ coordinate: CoordinateFingerprintV1 | null;
5
+ };
@@ -0,0 +1,16 @@
1
+ import type { ErrorWitnessV1 } from "./ErrorWitnessV1";
2
+ /**
3
+ * A structured, stable error equality contract.
4
+ */
5
+ export type NormalizedPolygonizeErrorV1 = {
6
+ schema_version: number;
7
+ family: string;
8
+ code: string;
9
+ stage: string;
10
+ field: string | null;
11
+ expected: string | null;
12
+ actual: string | null;
13
+ limit: string | null;
14
+ observed: string | null;
15
+ witness: ErrorWitnessV1 | null;
16
+ };
@@ -0,0 +1,12 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { ProvenanceFingerprintV1 } from "./ProvenanceFingerprintV1";
3
+ import type { RingFingerprintV1 } from "./RingFingerprintV1";
4
+ export type PolygonFingerprintV1 = {
5
+ exterior: Array<CoordinateFingerprintV1>;
6
+ interiors: Array<RingFingerprintV1>;
7
+ /**
8
+ * Per-edge representative input IDs, encoded as fixed-width hex strings.
9
+ */
10
+ exterior_edge_ids: Array<string>;
11
+ provenance: ProvenanceFingerprintV1 | null;
12
+ };
@@ -0,0 +1,7 @@
1
+ export type ProvenanceFingerprintV1 = {
2
+ /**
3
+ * Complete source sets, never JSON numbers, so JavaScript cannot lose IDs.
4
+ */
5
+ boundary_line_ids: Array<string>;
6
+ input_profile_id: string | null;
7
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type RingFingerprintV1 = {
3
+ coordinates: Array<CoordinateFingerprintV1>;
4
+ edge_ids: Array<string>;
5
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Only topology-level diagnostics. Timings and work counters are deliberately excluded.
3
+ */
4
+ export type TopologyDiagnosticsFingerprintV1 = {
5
+ dangle_count: number;
6
+ cut_edge_count: number;
7
+ ring_count: number;
8
+ shell_count: number;
9
+ hole_count: number;
10
+ unassigned_hole_count: number;
11
+ unassigned_hole_area: string;
12
+ invalid_ring_count: number;
13
+ z_conflict_node_count: number;
14
+ z_conflicting_line_ids: Array<string>;
15
+ };
@@ -0,0 +1,18 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { PolygonFingerprintV1 } from "./PolygonFingerprintV1";
3
+ import type { TopologyDiagnosticsFingerprintV1 } from "./TopologyDiagnosticsFingerprintV1";
4
+ /**
5
+ * A versioned, structured canonical representation of a successful run.
6
+ */
7
+ export type TopologyFingerprintV1 = {
8
+ schema_version: number;
9
+ /**
10
+ * The serialized canonical options object is part of the semantic contract.
11
+ */
12
+ options: unknown;
13
+ polygons: Array<PolygonFingerprintV1>;
14
+ dangles: Array<Array<CoordinateFingerprintV1>>;
15
+ cut_edges: Array<Array<CoordinateFingerprintV1>>;
16
+ invalid_rings: Array<Array<CoordinateFingerprintV1>>;
17
+ diagnostics: TopologyDiagnosticsFingerprintV1 | null;
18
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * An exact finite coordinate. Every component is an IEEE-754 bit pattern.
3
+ */
4
+ export type CoordinateFingerprintV1 = {
5
+ x: string;
6
+ y: string;
7
+ z: string;
8
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type ErrorWitnessV1 = {
3
+ ids: Array<string>;
4
+ coordinate: CoordinateFingerprintV1 | null;
5
+ };
@@ -0,0 +1,16 @@
1
+ import type { ErrorWitnessV1 } from "./ErrorWitnessV1";
2
+ /**
3
+ * A structured, stable error equality contract.
4
+ */
5
+ export type NormalizedPolygonizeErrorV1 = {
6
+ schema_version: number;
7
+ family: string;
8
+ code: string;
9
+ stage: string;
10
+ field: string | null;
11
+ expected: string | null;
12
+ actual: string | null;
13
+ limit: string | null;
14
+ observed: string | null;
15
+ witness: ErrorWitnessV1 | null;
16
+ };
@@ -0,0 +1,12 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { ProvenanceFingerprintV1 } from "./ProvenanceFingerprintV1";
3
+ import type { RingFingerprintV1 } from "./RingFingerprintV1";
4
+ export type PolygonFingerprintV1 = {
5
+ exterior: Array<CoordinateFingerprintV1>;
6
+ interiors: Array<RingFingerprintV1>;
7
+ /**
8
+ * Per-edge representative input IDs, encoded as fixed-width hex strings.
9
+ */
10
+ exterior_edge_ids: Array<string>;
11
+ provenance: ProvenanceFingerprintV1 | null;
12
+ };
@@ -0,0 +1,7 @@
1
+ export type ProvenanceFingerprintV1 = {
2
+ /**
3
+ * Complete source sets, never JSON numbers, so JavaScript cannot lose IDs.
4
+ */
5
+ boundary_line_ids: Array<string>;
6
+ input_profile_id: string | null;
7
+ };
@@ -0,0 +1,5 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ export type RingFingerprintV1 = {
3
+ coordinates: Array<CoordinateFingerprintV1>;
4
+ edge_ids: Array<string>;
5
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Only topology-level diagnostics. Timings and work counters are deliberately excluded.
3
+ */
4
+ export type TopologyDiagnosticsFingerprintV1 = {
5
+ dangle_count: number;
6
+ cut_edge_count: number;
7
+ ring_count: number;
8
+ shell_count: number;
9
+ hole_count: number;
10
+ unassigned_hole_count: number;
11
+ unassigned_hole_area: string;
12
+ invalid_ring_count: number;
13
+ z_conflict_node_count: number;
14
+ z_conflicting_line_ids: Array<string>;
15
+ };
@@ -0,0 +1,18 @@
1
+ import type { CoordinateFingerprintV1 } from "./CoordinateFingerprintV1";
2
+ import type { PolygonFingerprintV1 } from "./PolygonFingerprintV1";
3
+ import type { TopologyDiagnosticsFingerprintV1 } from "./TopologyDiagnosticsFingerprintV1";
4
+ /**
5
+ * A versioned, structured canonical representation of a successful run.
6
+ */
7
+ export type TopologyFingerprintV1 = {
8
+ schema_version: number;
9
+ /**
10
+ * The serialized canonical options object is part of the semantic contract.
11
+ */
12
+ options: unknown;
13
+ polygons: Array<PolygonFingerprintV1>;
14
+ dangles: Array<Array<CoordinateFingerprintV1>>;
15
+ cut_edges: Array<Array<CoordinateFingerprintV1>>;
16
+ invalid_rings: Array<Array<CoordinateFingerprintV1>>;
17
+ diagnostics: TopologyDiagnosticsFingerprintV1 | null;
18
+ };
@@ -15,5 +15,7 @@ export * from "./bindings/TileOwnershipPolicy";
15
15
  export * from "./bindings/TouchPolicy";
16
16
  export * from "./bindings/ZOptions";
17
17
  export * from "./bindings/ZPolicy";
18
+ export * from "./bindings/TopologyFingerprintV1";
19
+ export * from "./bindings/NormalizedPolygonizeErrorV1";
18
20
  export * from "./cfb";
19
21
  export default function init(_input?: any): Promise<typeof exports>;