@carto/api-client 0.5.6-alpha.0 → 0.5.6-alpha.bundle.2

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.
@@ -476,6 +476,13 @@ type TilesetSourceOptions = {
476
476
  * are used by default if the runtime environment supports ES Module Workers.
477
477
  */
478
478
  widgetWorker?: boolean;
479
+ /**
480
+ * Script URL used to create Web Workers for local widget calculations. In
481
+ * most cases a custom URL is not needed; bundlers will resolve the worker
482
+ * URL from a `@carto/api-client/worker` import internally. Advanced uses
483
+ * may require deploying the script manually and providing a custom URL.
484
+ */
485
+ widgetWorkerUrl?: string;
479
486
  };
480
487
  type ColumnsOption = {
481
488
  /**
@@ -476,6 +476,13 @@ type TilesetSourceOptions = {
476
476
  * are used by default if the runtime environment supports ES Module Workers.
477
477
  */
478
478
  widgetWorker?: boolean;
479
+ /**
480
+ * Script URL used to create Web Workers for local widget calculations. In
481
+ * most cases a custom URL is not needed; bundlers will resolve the worker
482
+ * URL from a `@carto/api-client/worker` import internally. Advanced uses
483
+ * may require deploying the script manually and providing a custom URL.
484
+ */
485
+ widgetWorkerUrl?: string;
479
486
  };
480
487
  type ColumnsOption = {
481
488
  /**
@@ -7467,13 +7467,23 @@ var WidgetTilesetSource = class extends WidgetSource {
7467
7467
  if (this._workerImpl) {
7468
7468
  return this._workerImpl;
7469
7469
  }
7470
- this._workerImpl = new Worker(
7471
- new URL("@carto/api-client/worker", import.meta.url),
7472
- {
7470
+ if (this.props.widgetWorkerUrl) {
7471
+ this._workerImpl = new Worker(this.props.widgetWorkerUrl, {
7473
7472
  type: "module",
7474
7473
  name: "cartowidgettileset"
7475
- }
7476
- );
7474
+ });
7475
+ } else {
7476
+ this._workerImpl = new Worker(
7477
+ new URL("@carto/api-client/worker", import.meta.url),
7478
+ {
7479
+ type: "module",
7480
+ name: "cartowidgettileset"
7481
+ }
7482
+ );
7483
+ }
7484
+ this._workerImpl.addEventListener("error", (e) => {
7485
+ console.error("widget-tileset-source worker error", e);
7486
+ });
7477
7487
  this._workerImpl.postMessage({
7478
7488
  method: "init" /* INIT */,
7479
7489
  params: [this.props]