geo-polygonize 0.65.0 → 0.67.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.
package/README.md CHANGED
@@ -281,6 +281,22 @@ async function run() {
281
281
  }
282
282
  ```
283
283
 
284
+ For cancellable browser work, use the worker-backed asynchronous entry point.
285
+ Aborting terminates its disposable worker; the direct Wasm exports above remain
286
+ synchronous and cannot be interrupted with an `AbortSignal`.
287
+
288
+ ```javascript
289
+ import { polygonizeWithOptionsAsync } from "geo-polygonize";
290
+
291
+ const controller = new AbortController();
292
+ const result = await polygonizeWithOptionsAsync(
293
+ JSON.stringify(geojson),
294
+ cfbRobustOptions,
295
+ { signal: controller.signal },
296
+ );
297
+ // controller.abort();
298
+ ```
299
+
284
300
  **Multithreaded Usage (Experimental):**
285
301
  This library provides a multithreaded build powered by `wasm-bindgen-rayon`.
286
302
 
Binary file
Binary file
@@ -1,4 +1,5 @@
1
1
  import * as exports from "../pkg-scalar/geo_polygonize.js";
2
+ import type { PolygonizerOptions } from "./bindings/PolygonizerOptions";
2
3
  export * from "../pkg-scalar/geo_polygonize.js";
3
4
  export * from "./bindings/PolygonizerOptions";
4
5
  export * from "./bindings/ContainmentOptions";
@@ -18,4 +19,16 @@ export * from "./bindings/ZPolicy";
18
19
  export * from "./bindings/TopologyFingerprintV1";
19
20
  export * from "./bindings/NormalizedPolygonizeErrorV1";
20
21
  export * from "./cfb";
22
+ export type WasmWorkerOptions = {
23
+ signal?: AbortSignal;
24
+ };
25
+ /**
26
+ * Polygonizes GeoJSON in an isolated browser worker.
27
+ *
28
+ * Aborting terminates that worker; direct Wasm exports remain synchronous and
29
+ * cannot be interrupted with an `AbortSignal`.
30
+ */
31
+ export declare function polygonizeWithOptionsAsync(geojson: string, options: Partial<PolygonizerOptions>, workerOptions?: WasmWorkerOptions): Promise<string>;
32
+ /** Returns the canonical topology report in an abortable browser worker. */
33
+ export declare function polygonizeReportWithOptionsAsync(geojson: string, options: Partial<PolygonizerOptions>, workerOptions?: WasmWorkerOptions): Promise<string>;
21
34
  export default function init(_input?: any): Promise<typeof exports>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  import * as exports from "../pkg-scalar/geo_polygonize.js";
2
+ import type { PolygonizerOptions } from "./bindings/PolygonizerOptions";
2
3
  export * from "../pkg-scalar/geo_polygonize.js";
3
4
  export * from "./bindings/PolygonizerOptions";
4
5
  export * from "./bindings/ContainmentOptions";
@@ -18,4 +19,16 @@ export * from "./bindings/ZPolicy";
18
19
  export * from "./bindings/TopologyFingerprintV1";
19
20
  export * from "./bindings/NormalizedPolygonizeErrorV1";
20
21
  export * from "./cfb";
22
+ export type WasmWorkerOptions = {
23
+ signal?: AbortSignal;
24
+ };
25
+ /**
26
+ * Polygonizes GeoJSON in an isolated browser worker.
27
+ *
28
+ * Aborting terminates that worker; direct Wasm exports remain synchronous and
29
+ * cannot be interrupted with an `AbortSignal`.
30
+ */
31
+ export declare function polygonizeWithOptionsAsync(geojson: string, options: Partial<PolygonizerOptions>, workerOptions?: WasmWorkerOptions): Promise<string>;
32
+ /** Returns the canonical topology report in an abortable browser worker. */
33
+ export declare function polygonizeReportWithOptionsAsync(geojson: string, options: Partial<PolygonizerOptions>, workerOptions?: WasmWorkerOptions): Promise<string>;
21
34
  export default function init(_input?: any): Promise<typeof exports>;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  import * as exports from "../pkg-scalar/geo_polygonize.js";
2
+ import type { PolygonizerOptions } from "./bindings/PolygonizerOptions";
2
3
  export * from "../pkg-scalar/geo_polygonize.js";
3
4
  export * from "./bindings/PolygonizerOptions";
4
5
  export * from "./bindings/ContainmentOptions";
@@ -18,4 +19,16 @@ export * from "./bindings/ZPolicy";
18
19
  export * from "./bindings/TopologyFingerprintV1";
19
20
  export * from "./bindings/NormalizedPolygonizeErrorV1";
20
21
  export * from "./cfb";
22
+ export type WasmWorkerOptions = {
23
+ signal?: AbortSignal;
24
+ };
25
+ /**
26
+ * Polygonizes GeoJSON in an isolated browser worker.
27
+ *
28
+ * Aborting terminates that worker; direct Wasm exports remain synchronous and
29
+ * cannot be interrupted with an `AbortSignal`.
30
+ */
31
+ export declare function polygonizeWithOptionsAsync(geojson: string, options: Partial<PolygonizerOptions>, workerOptions?: WasmWorkerOptions): Promise<string>;
32
+ /** Returns the canonical topology report in an abortable browser worker. */
33
+ export declare function polygonizeReportWithOptionsAsync(geojson: string, options: Partial<PolygonizerOptions>, workerOptions?: WasmWorkerOptions): Promise<string>;
21
34
  export default function init(_input?: any): Promise<typeof exports>;