@honua/react 0.0.20-alpha.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/LICENSE +201 -0
- package/README.md +9 -0
- package/contract/analytics-sources.d.ts +149 -0
- package/contract/analytics-sources.d.ts.map +1 -0
- package/contract/analytics-sources.js +235 -0
- package/contract/edit-session.d.ts +203 -0
- package/contract/edit-session.d.ts.map +1 -0
- package/contract/edit-session.js +760 -0
- package/contract/edit-sketch.d.ts +91 -0
- package/contract/edit-sketch.d.ts.map +1 -0
- package/contract/edit-sketch.js +281 -0
- package/contract/index.d.ts +61 -0
- package/contract/index.d.ts.map +1 -0
- package/contract/index.js +51 -0
- package/contract/jobs.d.ts +149 -0
- package/contract/jobs.d.ts.map +1 -0
- package/contract/jobs.js +40 -0
- package/contract/source.d.ts +423 -0
- package/contract/source.d.ts.map +1 -0
- package/contract/source.js +3802 -0
- package/contract/spatial-aggregation.d.ts +336 -0
- package/contract/spatial-aggregation.d.ts.map +1 -0
- package/contract/spatial-aggregation.js +298 -0
- package/contract/temporal.d.ts +455 -0
- package/contract/temporal.d.ts.map +1 -0
- package/contract/temporal.js +146 -0
- package/contract/tiles.d.ts +370 -0
- package/contract/tiles.d.ts.map +1 -0
- package/contract/tiles.js +519 -0
- package/contract/types.d.ts +665 -0
- package/contract/types.d.ts.map +1 -0
- package/contract/types.js +175 -0
- package/contract/widget-source.d.ts +205 -0
- package/contract/widget-source.d.ts.map +1 -0
- package/contract/widget-source.js +1473 -0
- package/control-plane/client.d.ts +95 -0
- package/control-plane/client.d.ts.map +1 -0
- package/control-plane/client.js +374 -0
- package/control-plane/index.d.ts +18 -0
- package/control-plane/index.d.ts.map +1 -0
- package/control-plane/index.js +14 -0
- package/control-plane/types.d.ts +233 -0
- package/control-plane/types.d.ts.map +1 -0
- package/control-plane/types.js +7 -0
- package/core/batch.d.ts +37 -0
- package/core/batch.d.ts.map +1 -0
- package/core/batch.js +79 -0
- package/core/cache-state.d.ts +79 -0
- package/core/cache-state.d.ts.map +1 -0
- package/core/cache-state.js +87 -0
- package/core/client.d.ts +577 -0
- package/core/client.d.ts.map +1 -0
- package/core/client.js +1664 -0
- package/core/compatibility.d.ts +18 -0
- package/core/compatibility.d.ts.map +1 -0
- package/core/compatibility.js +245 -0
- package/core/errors.d.ts +107 -0
- package/core/errors.d.ts.map +1 -0
- package/core/errors.js +156 -0
- package/core/esri-geojson.d.ts +66 -0
- package/core/esri-geojson.d.ts.map +1 -0
- package/core/esri-geojson.js +363 -0
- package/core/geoservices.d.ts +34 -0
- package/core/geoservices.d.ts.map +1 -0
- package/core/geoservices.js +434 -0
- package/core/grpc-adapter.d.ts +23 -0
- package/core/grpc-adapter.d.ts.map +1 -0
- package/core/grpc-adapter.js +688 -0
- package/core/odata.d.ts +347 -0
- package/core/odata.d.ts.map +1 -0
- package/core/odata.js +913 -0
- package/core/ogc-conformance.d.ts +35 -0
- package/core/ogc-conformance.d.ts.map +1 -0
- package/core/ogc-conformance.js +134 -0
- package/core/ogc-features.d.ts +23 -0
- package/core/ogc-features.d.ts.map +1 -0
- package/core/ogc-features.js +114 -0
- package/core/ogc-maps.d.ts +49 -0
- package/core/ogc-maps.d.ts.map +1 -0
- package/core/ogc-maps.js +126 -0
- package/core/ogc-processes.d.ts +118 -0
- package/core/ogc-processes.d.ts.map +1 -0
- package/core/ogc-processes.js +423 -0
- package/core/ogc-records.d.ts +75 -0
- package/core/ogc-records.d.ts.map +1 -0
- package/core/ogc-records.js +251 -0
- package/core/ogc-tiles.d.ts +125 -0
- package/core/ogc-tiles.d.ts.map +1 -0
- package/core/ogc-tiles.js +183 -0
- package/core/path-utils.d.ts +69 -0
- package/core/path-utils.d.ts.map +1 -0
- package/core/path-utils.js +123 -0
- package/core/pbf-decoder.d.ts +39 -0
- package/core/pbf-decoder.d.ts.map +1 -0
- package/core/pbf-decoder.js +702 -0
- package/core/process-runner.d.ts +104 -0
- package/core/process-runner.d.ts.map +1 -0
- package/core/process-runner.js +315 -0
- package/core/protocol-transport.d.ts +76 -0
- package/core/protocol-transport.d.ts.map +1 -0
- package/core/protocol-transport.js +15 -0
- package/core/query-builder.d.ts +261 -0
- package/core/query-builder.d.ts.map +1 -0
- package/core/query-builder.js +538 -0
- package/core/request-pipeline.d.ts +88 -0
- package/core/request-pipeline.d.ts.map +1 -0
- package/core/request-pipeline.js +273 -0
- package/core/spatial-filter.d.ts +93 -0
- package/core/spatial-filter.d.ts.map +1 -0
- package/core/spatial-filter.js +153 -0
- package/core/stac.d.ts +55 -0
- package/core/stac.d.ts.map +1 -0
- package/core/stac.js +229 -0
- package/core/surfaces.d.ts +527 -0
- package/core/surfaces.d.ts.map +1 -0
- package/core/surfaces.js +1917 -0
- package/core/terrain-elevation.d.ts +114 -0
- package/core/terrain-elevation.d.ts.map +1 -0
- package/core/terrain-elevation.js +150 -0
- package/core/types.d.ts +1355 -0
- package/core/types.d.ts.map +1 -0
- package/core/types.js +13 -0
- package/core/wfs-capabilities.d.ts +143 -0
- package/core/wfs-capabilities.d.ts.map +1 -0
- package/core/wfs-capabilities.js +478 -0
- package/core/wfs-filter.d.ts +118 -0
- package/core/wfs-filter.d.ts.map +1 -0
- package/core/wfs-filter.js +634 -0
- package/core/wfs.d.ts +219 -0
- package/core/wfs.d.ts.map +1 -0
- package/core/wfs.js +406 -0
- package/core/wire-shared.d.ts +32 -0
- package/core/wire-shared.d.ts.map +1 -0
- package/core/wire-shared.js +76 -0
- package/core/wms-axis.d.ts +36 -0
- package/core/wms-axis.d.ts.map +1 -0
- package/core/wms-axis.js +73 -0
- package/core/wms-capabilities.d.ts +110 -0
- package/core/wms-capabilities.d.ts.map +1 -0
- package/core/wms-capabilities.js +559 -0
- package/core/wms-types.d.ts +128 -0
- package/core/wms-types.d.ts.map +1 -0
- package/core/wms-types.js +32 -0
- package/core/wms.d.ts +144 -0
- package/core/wms.d.ts.map +1 -0
- package/core/wms.js +338 -0
- package/core/wmts-capabilities.d.ts +82 -0
- package/core/wmts-capabilities.d.ts.map +1 -0
- package/core/wmts-capabilities.js +402 -0
- package/core/wmts.d.ts +103 -0
- package/core/wmts.d.ts.map +1 -0
- package/core/wmts.js +332 -0
- package/core/xml-text.d.ts +20 -0
- package/core/xml-text.d.ts.map +1 -0
- package/core/xml-text.js +85 -0
- package/esri-compat/basemap-gallery.d.ts +38 -0
- package/esri-compat/basemap-gallery.d.ts.map +1 -0
- package/esri-compat/basemap-gallery.js +159 -0
- package/esri-compat/basemap-layer-list.d.ts +35 -0
- package/esri-compat/basemap-layer-list.d.ts.map +1 -0
- package/esri-compat/basemap-layer-list.js +139 -0
- package/esri-compat/basemap.d.ts +32 -0
- package/esri-compat/basemap.d.ts.map +1 -0
- package/esri-compat/basemap.js +84 -0
- package/esri-compat/bookmarks.d.ts +36 -0
- package/esri-compat/bookmarks.d.ts.map +1 -0
- package/esri-compat/bookmarks.js +108 -0
- package/esri-compat/class-breaks-renderer.d.ts +50 -0
- package/esri-compat/class-breaks-renderer.d.ts.map +1 -0
- package/esri-compat/class-breaks-renderer.js +164 -0
- package/esri-compat/color.d.ts +22 -0
- package/esri-compat/color.d.ts.map +1 -0
- package/esri-compat/color.js +106 -0
- package/esri-compat/controls.d.ts +174 -0
- package/esri-compat/controls.d.ts.map +1 -0
- package/esri-compat/controls.js +479 -0
- package/esri-compat/coordinate-conversion.d.ts +41 -0
- package/esri-compat/coordinate-conversion.d.ts.map +1 -0
- package/esri-compat/coordinate-conversion.js +125 -0
- package/esri-compat/directions.d.ts +45 -0
- package/esri-compat/directions.d.ts.map +1 -0
- package/esri-compat/directions.js +123 -0
- package/esri-compat/editor.d.ts +47 -0
- package/esri-compat/editor.d.ts.map +1 -0
- package/esri-compat/editor.js +170 -0
- package/esri-compat/esri-config.d.ts +16 -0
- package/esri-compat/esri-config.d.ts.map +1 -0
- package/esri-compat/esri-config.js +23 -0
- package/esri-compat/esri-request.d.ts +17 -0
- package/esri-compat/esri-request.d.ts.map +1 -0
- package/esri-compat/esri-request.js +127 -0
- package/esri-compat/event-bus.d.ts +106 -0
- package/esri-compat/event-bus.d.ts.map +1 -0
- package/esri-compat/event-bus.js +90 -0
- package/esri-compat/expand.d.ts +36 -0
- package/esri-compat/expand.d.ts.map +1 -0
- package/esri-compat/expand.js +97 -0
- package/esri-compat/extent.d.ts +43 -0
- package/esri-compat/extent.d.ts.map +1 -0
- package/esri-compat/extent.js +140 -0
- package/esri-compat/feature-filter.d.ts +55 -0
- package/esri-compat/feature-filter.d.ts.map +1 -0
- package/esri-compat/feature-filter.js +109 -0
- package/esri-compat/feature-form.d.ts +64 -0
- package/esri-compat/feature-form.d.ts.map +1 -0
- package/esri-compat/feature-form.js +137 -0
- package/esri-compat/feature-layer.d.ts +173 -0
- package/esri-compat/feature-layer.d.ts.map +1 -0
- package/esri-compat/feature-layer.js +661 -0
- package/esri-compat/feature-set.d.ts +32 -0
- package/esri-compat/feature-set.d.ts.map +1 -0
- package/esri-compat/feature-set.js +80 -0
- package/esri-compat/feature-table.d.ts +141 -0
- package/esri-compat/feature-table.d.ts.map +1 -0
- package/esri-compat/feature-table.js +500 -0
- package/esri-compat/feature-templates.d.ts +41 -0
- package/esri-compat/feature-templates.d.ts.map +1 -0
- package/esri-compat/feature-templates.js +97 -0
- package/esri-compat/feature.d.ts +33 -0
- package/esri-compat/feature.d.ts.map +1 -0
- package/esri-compat/feature.js +83 -0
- package/esri-compat/geojson-layer.d.ts +86 -0
- package/esri-compat/geojson-layer.d.ts.map +1 -0
- package/esri-compat/geojson-layer.js +191 -0
- package/esri-compat/geometry-engine.d.ts +107 -0
- package/esri-compat/geometry-engine.d.ts.map +1 -0
- package/esri-compat/geometry-engine.js +266 -0
- package/esri-compat/graphic.d.ts +46 -0
- package/esri-compat/graphic.d.ts.map +1 -0
- package/esri-compat/graphic.js +103 -0
- package/esri-compat/graphics-layer.d.ts +49 -0
- package/esri-compat/graphics-layer.d.ts.map +1 -0
- package/esri-compat/graphics-layer.js +185 -0
- package/esri-compat/group-layer.d.ts +48 -0
- package/esri-compat/group-layer.d.ts.map +1 -0
- package/esri-compat/group-layer.js +212 -0
- package/esri-compat/identify.d.ts +71 -0
- package/esri-compat/identify.d.ts.map +1 -0
- package/esri-compat/identify.js +299 -0
- package/esri-compat/identity-manager.d.ts +31 -0
- package/esri-compat/identity-manager.d.ts.map +1 -0
- package/esri-compat/identity-manager.js +115 -0
- package/esri-compat/imagery-layer.d.ts +78 -0
- package/esri-compat/imagery-layer.d.ts.map +1 -0
- package/esri-compat/imagery-layer.js +167 -0
- package/esri-compat/label-class.d.ts +31 -0
- package/esri-compat/label-class.d.ts.map +1 -0
- package/esri-compat/label-class.js +102 -0
- package/esri-compat/layer-list.d.ts +77 -0
- package/esri-compat/layer-list.d.ts.map +1 -0
- package/esri-compat/layer-list.js +342 -0
- package/esri-compat/legend.d.ts +53 -0
- package/esri-compat/legend.d.ts.map +1 -0
- package/esri-compat/legend.js +254 -0
- package/esri-compat/map-image-layer.d.ts +162 -0
- package/esri-compat/map-image-layer.d.ts.map +1 -0
- package/esri-compat/map-image-layer.js +709 -0
- package/esri-compat/map-view.d.ts +323 -0
- package/esri-compat/map-view.d.ts.map +1 -0
- package/esri-compat/map-view.js +1175 -0
- package/esri-compat/map.d.ts +47 -0
- package/esri-compat/map.d.ts.map +1 -0
- package/esri-compat/map.js +209 -0
- package/esri-compat/measurement-2d.d.ts +61 -0
- package/esri-compat/measurement-2d.d.ts.map +1 -0
- package/esri-compat/measurement-2d.js +184 -0
- package/esri-compat/measurement.d.ts +45 -0
- package/esri-compat/measurement.d.ts.map +1 -0
- package/esri-compat/measurement.js +193 -0
- package/esri-compat/oauth-info.d.ts +35 -0
- package/esri-compat/oauth-info.d.ts.map +1 -0
- package/esri-compat/oauth-info.js +115 -0
- package/esri-compat/picture-marker-symbol.d.ts +35 -0
- package/esri-compat/picture-marker-symbol.d.ts.map +1 -0
- package/esri-compat/picture-marker-symbol.js +126 -0
- package/esri-compat/point.d.ts +31 -0
- package/esri-compat/point.d.ts.map +1 -0
- package/esri-compat/point.js +102 -0
- package/esri-compat/polygon.d.ts +31 -0
- package/esri-compat/polygon.d.ts.map +1 -0
- package/esri-compat/polygon.js +107 -0
- package/esri-compat/polyline.d.ts +31 -0
- package/esri-compat/polyline.d.ts.map +1 -0
- package/esri-compat/polyline.js +107 -0
- package/esri-compat/popup-template.d.ts +55 -0
- package/esri-compat/popup-template.d.ts.map +1 -0
- package/esri-compat/popup-template.js +128 -0
- package/esri-compat/popup.d.ts +54 -0
- package/esri-compat/popup.d.ts.map +1 -0
- package/esri-compat/popup.js +312 -0
- package/esri-compat/print.d.ts +47 -0
- package/esri-compat/print.d.ts.map +1 -0
- package/esri-compat/print.js +105 -0
- package/esri-compat/query.d.ts +58 -0
- package/esri-compat/query.d.ts.map +1 -0
- package/esri-compat/query.js +128 -0
- package/esri-compat/reactive-utils.d.ts +24 -0
- package/esri-compat/reactive-utils.d.ts.map +1 -0
- package/esri-compat/reactive-utils.js +193 -0
- package/esri-compat/request.d.ts +41 -0
- package/esri-compat/request.d.ts.map +1 -0
- package/esri-compat/request.js +253 -0
- package/esri-compat/route-layer.d.ts +59 -0
- package/esri-compat/route-layer.d.ts.map +1 -0
- package/esri-compat/route-layer.js +223 -0
- package/esri-compat/route-task.d.ts +88 -0
- package/esri-compat/route-task.d.ts.map +1 -0
- package/esri-compat/route-task.js +225 -0
- package/esri-compat/scene-view.d.ts +41 -0
- package/esri-compat/scene-view.d.ts.map +1 -0
- package/esri-compat/scene-view.js +68 -0
- package/esri-compat/search.d.ts +112 -0
- package/esri-compat/search.d.ts.map +1 -0
- package/esri-compat/search.js +820 -0
- package/esri-compat/simple-fill-symbol.d.ts +27 -0
- package/esri-compat/simple-fill-symbol.d.ts.map +1 -0
- package/esri-compat/simple-fill-symbol.js +85 -0
- package/esri-compat/simple-line-symbol.d.ts +27 -0
- package/esri-compat/simple-line-symbol.d.ts.map +1 -0
- package/esri-compat/simple-line-symbol.js +85 -0
- package/esri-compat/simple-marker-symbol.d.ts +29 -0
- package/esri-compat/simple-marker-symbol.d.ts.map +1 -0
- package/esri-compat/simple-marker-symbol.js +92 -0
- package/esri-compat/simple-renderer.d.ts +29 -0
- package/esri-compat/simple-renderer.d.ts.map +1 -0
- package/esri-compat/simple-renderer.js +92 -0
- package/esri-compat/sketch.d.ts +64 -0
- package/esri-compat/sketch.d.ts.map +1 -0
- package/esri-compat/sketch.js +227 -0
- package/esri-compat/spatial-reference.d.ts +31 -0
- package/esri-compat/spatial-reference.d.ts.map +1 -0
- package/esri-compat/spatial-reference.js +102 -0
- package/esri-compat/swipe.d.ts +34 -0
- package/esri-compat/swipe.d.ts.map +1 -0
- package/esri-compat/swipe.js +93 -0
- package/esri-compat/table-list.d.ts +36 -0
- package/esri-compat/table-list.d.ts.map +1 -0
- package/esri-compat/table-list.js +126 -0
- package/esri-compat/text-symbol.d.ts +37 -0
- package/esri-compat/text-symbol.d.ts.map +1 -0
- package/esri-compat/text-symbol.js +123 -0
- package/esri-compat/tile-layer.d.ts +52 -0
- package/esri-compat/tile-layer.d.ts.map +1 -0
- package/esri-compat/tile-layer.js +168 -0
- package/esri-compat/time-slider.d.ts +70 -0
- package/esri-compat/time-slider.d.ts.map +1 -0
- package/esri-compat/time-slider.js +208 -0
- package/esri-compat/track.d.ts +51 -0
- package/esri-compat/track.d.ts.map +1 -0
- package/esri-compat/track.js +174 -0
- package/esri-compat/unique-value-renderer.d.ts +41 -0
- package/esri-compat/unique-value-renderer.d.ts.map +1 -0
- package/esri-compat/unique-value-renderer.js +127 -0
- package/esri-compat/url.d.ts +13 -0
- package/esri-compat/url.d.ts.map +1 -0
- package/esri-compat/url.js +68 -0
- package/esri-compat/vector-tile-layer.d.ts +47 -0
- package/esri-compat/vector-tile-layer.d.ts.map +1 -0
- package/esri-compat/vector-tile-layer.js +130 -0
- package/esri-compat/web-map.d.ts +14 -0
- package/esri-compat/web-map.d.ts.map +1 -0
- package/esri-compat/web-map.js +24 -0
- package/esri-compat/wfs-layer.d.ts +64 -0
- package/esri-compat/wfs-layer.d.ts.map +1 -0
- package/esri-compat/wfs-layer.js +145 -0
- package/esri-compat/wms-layer.d.ts +76 -0
- package/esri-compat/wms-layer.d.ts.map +1 -0
- package/esri-compat/wms-layer.js +157 -0
- package/exploration/context.d.ts +25 -0
- package/exploration/context.d.ts.map +1 -0
- package/exploration/context.js +396 -0
- package/exploration/index.d.ts +27 -0
- package/exploration/index.d.ts.map +1 -0
- package/exploration/index.js +24 -0
- package/exploration/presets.d.ts +27 -0
- package/exploration/presets.d.ts.map +1 -0
- package/exploration/presets.js +114 -0
- package/exploration/reducer.d.ts +23 -0
- package/exploration/reducer.d.ts.map +1 -0
- package/exploration/reducer.js +332 -0
- package/exploration/selection.d.ts +25 -0
- package/exploration/selection.d.ts.map +1 -0
- package/exploration/selection.js +34 -0
- package/exploration/selectors.d.ts +56 -0
- package/exploration/selectors.d.ts.map +1 -0
- package/exploration/selectors.js +110 -0
- package/exploration/types.d.ts +294 -0
- package/exploration/types.d.ts.map +1 -0
- package/exploration/types.js +33 -0
- package/expr/expression.d.ts +457 -0
- package/expr/expression.d.ts.map +1 -0
- package/expr/expression.js +663 -0
- package/expr/index.d.ts +32 -0
- package/expr/index.d.ts.map +1 -0
- package/expr/index.js +30 -0
- package/gen/honua/v1/feature_service_pb.d.ts +918 -0
- package/gen/honua/v1/feature_service_pb.d.ts.map +1 -0
- package/gen/honua/v1/feature_service_pb.js +375 -0
- package/generated-app/errors.d.ts +41 -0
- package/generated-app/errors.d.ts.map +1 -0
- package/generated-app/errors.js +41 -0
- package/generated-app/index.d.ts +17 -0
- package/generated-app/index.d.ts.map +1 -0
- package/generated-app/index.js +12 -0
- package/generated-app/manifest.d.ts +183 -0
- package/generated-app/manifest.d.ts.map +1 -0
- package/generated-app/manifest.js +14 -0
- package/generated-app/projection.d.ts +44 -0
- package/generated-app/projection.d.ts.map +1 -0
- package/generated-app/projection.js +234 -0
- package/generated-app/runtime.d.ts +215 -0
- package/generated-app/runtime.d.ts.map +1 -0
- package/generated-app/runtime.js +1196 -0
- package/interactions/detail-model.d.ts +54 -0
- package/interactions/detail-model.d.ts.map +1 -0
- package/interactions/detail-model.js +105 -0
- package/interactions/exploration-bindings.d.ts +120 -0
- package/interactions/exploration-bindings.d.ts.map +1 -0
- package/interactions/exploration-bindings.js +218 -0
- package/interactions/feature-state.d.ts +144 -0
- package/interactions/feature-state.d.ts.map +1 -0
- package/interactions/feature-state.js +169 -0
- package/interactions/hit-test.d.ts +112 -0
- package/interactions/hit-test.d.ts.map +1 -0
- package/interactions/hit-test.js +291 -0
- package/interactions/index.d.ts +31 -0
- package/interactions/index.d.ts.map +1 -0
- package/interactions/index.js +24 -0
- package/interactions/share-state.d.ts +36 -0
- package/interactions/share-state.d.ts.map +1 -0
- package/interactions/share-state.js +123 -0
- package/map/feature-service-adapter.d.ts +138 -0
- package/map/feature-service-adapter.d.ts.map +1 -0
- package/map/feature-service-adapter.js +279 -0
- package/map/honua-map.d.ts +203 -0
- package/map/honua-map.d.ts.map +1 -0
- package/map/honua-map.js +347 -0
- package/map/index.d.ts +27 -0
- package/map/index.d.ts.map +1 -0
- package/map/index.js +22 -0
- package/map/maplibre-target.d.ts +103 -0
- package/map/maplibre-target.d.ts.map +1 -0
- package/map/maplibre-target.js +164 -0
- package/map/webmap-maplibre.d.ts +60 -0
- package/map/webmap-maplibre.d.ts.map +1 -0
- package/map/webmap-maplibre.js +212 -0
- package/package.json +37 -0
- package/react/context.d.ts +32 -0
- package/react/context.d.ts.map +1 -0
- package/react/context.js +19 -0
- package/react/honua-layer.d.ts +35 -0
- package/react/honua-layer.d.ts.map +1 -0
- package/react/honua-layer.js +47 -0
- package/react/honua-map.d.ts +83 -0
- package/react/honua-map.d.ts.map +1 -0
- package/react/honua-map.js +109 -0
- package/react/honua-popup.d.ts +26 -0
- package/react/honua-popup.d.ts.map +1 -0
- package/react/honua-popup.js +34 -0
- package/react/hooks.d.ts +127 -0
- package/react/hooks.d.ts.map +1 -0
- package/react/hooks.js +206 -0
- package/react/index.d.ts +42 -0
- package/react/index.d.ts.map +1 -0
- package/react/index.js +34 -0
- package/react/provider.d.ts +36 -0
- package/react/provider.d.ts.map +1 -0
- package/react/provider.js +35 -0
- package/react/query-cache.d.ts +76 -0
- package/react/query-cache.d.ts.map +1 -0
- package/react/query-cache.js +188 -0
- package/runtime/diff.d.ts +31 -0
- package/runtime/diff.d.ts.map +1 -0
- package/runtime/diff.js +143 -0
- package/runtime/errors.d.ts +40 -0
- package/runtime/errors.d.ts.map +1 -0
- package/runtime/errors.js +35 -0
- package/runtime/index.d.ts +59 -0
- package/runtime/index.d.ts.map +1 -0
- package/runtime/index.js +43 -0
- package/runtime/legend.d.ts +23 -0
- package/runtime/legend.d.ts.map +1 -0
- package/runtime/legend.js +38 -0
- package/runtime/load-package.d.ts +125 -0
- package/runtime/load-package.d.ts.map +1 -0
- package/runtime/load-package.js +264 -0
- package/runtime/map-package-fetch.d.ts +107 -0
- package/runtime/map-package-fetch.d.ts.map +1 -0
- package/runtime/map-package-fetch.js +336 -0
- package/runtime/map-package-realtime.d.ts +169 -0
- package/runtime/map-package-realtime.d.ts.map +1 -0
- package/runtime/map-package-realtime.js +350 -0
- package/runtime/map-package-validation.d.ts +43 -0
- package/runtime/map-package-validation.d.ts.map +1 -0
- package/runtime/map-package-validation.js +269 -0
- package/runtime/map-package-watch.d.ts +78 -0
- package/runtime/map-package-watch.d.ts.map +1 -0
- package/runtime/map-package-watch.js +695 -0
- package/runtime/map-package.d.ts +167 -0
- package/runtime/map-package.d.ts.map +1 -0
- package/runtime/map-package.js +15 -0
- package/runtime/ogc-styles.d.ts +110 -0
- package/runtime/ogc-styles.d.ts.map +1 -0
- package/runtime/ogc-styles.js +195 -0
- package/runtime/popups.d.ts +62 -0
- package/runtime/popups.d.ts.map +1 -0
- package/runtime/popups.js +95 -0
- package/runtime/query-tiles.d.ts +217 -0
- package/runtime/query-tiles.d.ts.map +1 -0
- package/runtime/query-tiles.js +801 -0
- package/runtime/runtime.d.ts +243 -0
- package/runtime/runtime.d.ts.map +1 -0
- package/runtime/runtime.js +1147 -0
- package/runtime/source-bridge.d.ts +99 -0
- package/runtime/source-bridge.d.ts.map +1 -0
- package/runtime/source-bridge.js +401 -0
- package/runtime/style-compose.d.ts +46 -0
- package/runtime/style-compose.d.ts.map +1 -0
- package/runtime/style-compose.js +144 -0
- package/runtime/style-interactions.d.ts +141 -0
- package/runtime/style-interactions.d.ts.map +1 -0
- package/runtime/style-interactions.js +574 -0
- package/runtime/style-spec-validation.d.ts +23 -0
- package/runtime/style-spec-validation.d.ts.map +1 -0
- package/runtime/style-spec-validation.js +357 -0
- package/studio/capability-manifest.d.ts +285 -0
- package/studio/capability-manifest.d.ts.map +1 -0
- package/studio/capability-manifest.js +59 -0
- package/studio/chart-spec.d.ts +85 -0
- package/studio/chart-spec.d.ts.map +1 -0
- package/studio/chart-spec.js +106 -0
- package/studio/index.d.ts +34 -0
- package/studio/index.d.ts.map +1 -0
- package/studio/index.js +27 -0
- package/studio/provenance.d.ts +131 -0
- package/studio/provenance.d.ts.map +1 -0
- package/studio/provenance.js +39 -0
- package/studio/publish.d.ts +64 -0
- package/studio/publish.d.ts.map +1 -0
- package/studio/publish.js +13 -0
- package/studio/types.d.ts +278 -0
- package/studio/types.d.ts.map +1 -0
- package/studio/types.js +71 -0
- package/studio/validate.d.ts +45 -0
- package/studio/validate.d.ts.map +1 -0
- package/studio/validate.js +255 -0
- package/studio/validation.d.ts +112 -0
- package/studio/validation.d.ts.map +1 -0
- package/studio/validation.js +42 -0
- package/style/factory.d.ts +30 -0
- package/style/factory.d.ts.map +1 -0
- package/style/factory.js +61 -0
- package/style/index.d.ts +25 -0
- package/style/index.d.ts.map +1 -0
- package/style/index.js +24 -0
- package/style/specification.d.ts +203 -0
- package/style/specification.d.ts.map +1 -0
- package/style/specification.js +178 -0
- package/style/wms-wmts-resolvers.d.ts +38 -0
- package/style/wms-wmts-resolvers.d.ts.map +1 -0
- package/style/wms-wmts-resolvers.js +92 -0
- package/webmap/contract.d.ts +28 -0
- package/webmap/contract.d.ts.map +1 -0
- package/webmap/contract.js +130 -0
- package/webmap/convert-basemap.d.ts +17 -0
- package/webmap/convert-basemap.d.ts.map +1 -0
- package/webmap/convert-basemap.js +78 -0
- package/webmap/convert-extent.d.ts +17 -0
- package/webmap/convert-extent.d.ts.map +1 -0
- package/webmap/convert-extent.js +114 -0
- package/webmap/convert-label.d.ts +13 -0
- package/webmap/convert-label.d.ts.map +1 -0
- package/webmap/convert-label.js +125 -0
- package/webmap/convert-layer.d.ts +22 -0
- package/webmap/convert-layer.d.ts.map +1 -0
- package/webmap/convert-layer.js +181 -0
- package/webmap/convert-popup.d.ts +34 -0
- package/webmap/convert-popup.d.ts.map +1 -0
- package/webmap/convert-popup.js +68 -0
- package/webmap/convert-renderer.d.ts +17 -0
- package/webmap/convert-renderer.d.ts.map +1 -0
- package/webmap/convert-renderer.js +161 -0
- package/webmap/convert-symbol.d.ts +17 -0
- package/webmap/convert-symbol.d.ts.map +1 -0
- package/webmap/convert-symbol.js +122 -0
- package/webmap/index.d.ts +44 -0
- package/webmap/index.d.ts.map +1 -0
- package/webmap/index.js +33 -0
- package/webmap/parse.d.ts +25 -0
- package/webmap/parse.d.ts.map +1 -0
- package/webmap/parse.js +83 -0
- package/webmap/types.d.ts +264 -0
- package/webmap/types.d.ts.map +1 -0
- package/webmap/types.js +13 -0
- package/webmap/warnings.d.ts +30 -0
- package/webmap/warnings.d.ts.map +1 -0
- package/webmap/warnings.js +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactive-utils.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/reactive-utils.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACxC,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,+BAA+B;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK,OAAO,CAAC;CAC3D;AAED,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAKD,wBAAgB,KAAK,CAAC,MAAM,EAC1B,MAAM,EAAE,MAAM,MAAM,EACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EACjC,OAAO,CAAC,EAAE,+BAA+B,GACxC,yBAAyB,CAAC;AAC7B,wBAAgB,KAAK,CAAC,MAAM,EAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EACjC,OAAO,CAAC,EAAE,+BAA+B,GACxC,yBAAyB,CAAC;AA+E7B,wBAAgB,IAAI,CAAC,MAAM,EACzB,MAAM,EAAE,MAAM,MAAM,EACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EACjC,OAAO,GAAE,8BAAmC,GAC3C,yBAAyB,CAqD3B;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAC7B,MAAM,EAAE,MAAM,MAAM,EACpB,OAAO,GAAE,IAAI,CAAC,8BAA8B,EAAE,MAAM,CAAM,GACzD,OAAO,CAAC,MAAM,CAAC,CAejB;AAED,eAAO,MAAM,aAAa;;;;CAIzB,CAAC"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
const DEFAULT_INTERVAL_MS = 16;
|
|
2
|
+
const MAX_COMPARISON_DEPTH = 8;
|
|
3
|
+
export function watch(getterOrTarget, callbackOrProperty, callbackOrOptions, optionsArg) {
|
|
4
|
+
let getter;
|
|
5
|
+
let callback;
|
|
6
|
+
let options;
|
|
7
|
+
if (typeof getterOrTarget === "function") {
|
|
8
|
+
getter = getterOrTarget;
|
|
9
|
+
callback = callbackOrProperty;
|
|
10
|
+
options = callbackOrOptions ?? {};
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
const target = getterOrTarget;
|
|
14
|
+
const propertyName = callbackOrProperty;
|
|
15
|
+
getter = () => target[propertyName];
|
|
16
|
+
callback = callbackOrOptions;
|
|
17
|
+
options = optionsArg ?? {};
|
|
18
|
+
}
|
|
19
|
+
let active = true;
|
|
20
|
+
let hasValue = false;
|
|
21
|
+
let previousValue;
|
|
22
|
+
let previousComparable;
|
|
23
|
+
const intervalMs = normalizeInterval(options.intervalMs);
|
|
24
|
+
const evaluate = () => {
|
|
25
|
+
if (!active) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
let currentValue;
|
|
29
|
+
try {
|
|
30
|
+
currentValue = getter();
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const currentComparable = createComparableValue(currentValue);
|
|
36
|
+
if (!hasValue) {
|
|
37
|
+
hasValue = true;
|
|
38
|
+
previousValue = currentValue;
|
|
39
|
+
previousComparable = currentComparable;
|
|
40
|
+
if (options.initial) {
|
|
41
|
+
callback(currentValue);
|
|
42
|
+
if (options.once) {
|
|
43
|
+
remove();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (valuesEqual(currentValue, previousValue, currentComparable, previousComparable, options.equals)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
previousValue = currentValue;
|
|
52
|
+
previousComparable = currentComparable;
|
|
53
|
+
callback(currentValue);
|
|
54
|
+
if (options.once) {
|
|
55
|
+
remove();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const timer = setInterval(evaluate, intervalMs);
|
|
59
|
+
evaluate();
|
|
60
|
+
const remove = () => {
|
|
61
|
+
if (!active) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
active = false;
|
|
65
|
+
clearInterval(timer);
|
|
66
|
+
};
|
|
67
|
+
return { remove };
|
|
68
|
+
}
|
|
69
|
+
export function when(getter, callback, options = {}) {
|
|
70
|
+
let active = true;
|
|
71
|
+
let seenTruthy = false;
|
|
72
|
+
let hasEvaluated = false;
|
|
73
|
+
const intervalMs = normalizeInterval(options.intervalMs);
|
|
74
|
+
const once = options.once ?? false;
|
|
75
|
+
const initial = options.initial ?? true;
|
|
76
|
+
const evaluate = () => {
|
|
77
|
+
if (!active) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
let value;
|
|
81
|
+
try {
|
|
82
|
+
value = getter();
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const truthy = Boolean(value);
|
|
88
|
+
if (!truthy) {
|
|
89
|
+
seenTruthy = false;
|
|
90
|
+
hasEvaluated = true;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const isFirstEvaluation = !hasEvaluated;
|
|
94
|
+
const shouldNotify = !seenTruthy && (!isFirstEvaluation || initial);
|
|
95
|
+
if (shouldNotify) {
|
|
96
|
+
callback(value);
|
|
97
|
+
if (once) {
|
|
98
|
+
remove();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
seenTruthy = true;
|
|
103
|
+
hasEvaluated = true;
|
|
104
|
+
};
|
|
105
|
+
const timer = setInterval(evaluate, intervalMs);
|
|
106
|
+
evaluate();
|
|
107
|
+
const remove = () => {
|
|
108
|
+
if (!active) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
active = false;
|
|
112
|
+
clearInterval(timer);
|
|
113
|
+
};
|
|
114
|
+
return { remove };
|
|
115
|
+
}
|
|
116
|
+
export function whenOnce(getter, options = {}) {
|
|
117
|
+
return new Promise((resolve) => {
|
|
118
|
+
const handle = when(getter, (value) => {
|
|
119
|
+
handle.remove();
|
|
120
|
+
resolve(value);
|
|
121
|
+
}, {
|
|
122
|
+
...options,
|
|
123
|
+
initial: true,
|
|
124
|
+
once: true,
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
export const reactiveUtils = {
|
|
129
|
+
watch,
|
|
130
|
+
when,
|
|
131
|
+
whenOnce,
|
|
132
|
+
};
|
|
133
|
+
function normalizeInterval(intervalMs) {
|
|
134
|
+
if (typeof intervalMs !== "number" || !Number.isFinite(intervalMs) || intervalMs < 1) {
|
|
135
|
+
return DEFAULT_INTERVAL_MS;
|
|
136
|
+
}
|
|
137
|
+
return Math.max(1, Math.trunc(intervalMs));
|
|
138
|
+
}
|
|
139
|
+
function valuesEqual(current, previous, currentComparable, previousComparable, equals) {
|
|
140
|
+
if (equals) {
|
|
141
|
+
return equals(current, previous);
|
|
142
|
+
}
|
|
143
|
+
return Object.is(currentComparable, previousComparable);
|
|
144
|
+
}
|
|
145
|
+
function createComparableValue(value) {
|
|
146
|
+
if (Array.isArray(value) || isPlainObject(value)) {
|
|
147
|
+
return stableSerialize(value, 0, new WeakSet());
|
|
148
|
+
}
|
|
149
|
+
return value;
|
|
150
|
+
}
|
|
151
|
+
function stableSerialize(value, depth, seen) {
|
|
152
|
+
if (value === null) {
|
|
153
|
+
return "null";
|
|
154
|
+
}
|
|
155
|
+
if (depth >= MAX_COMPARISON_DEPTH) {
|
|
156
|
+
return '"[MaxDepth]"';
|
|
157
|
+
}
|
|
158
|
+
const valueType = typeof value;
|
|
159
|
+
if (valueType === "string") {
|
|
160
|
+
return JSON.stringify(value);
|
|
161
|
+
}
|
|
162
|
+
if (valueType === "number" || valueType === "boolean" || valueType === "bigint") {
|
|
163
|
+
return String(value);
|
|
164
|
+
}
|
|
165
|
+
if (valueType === "undefined") {
|
|
166
|
+
return "undefined";
|
|
167
|
+
}
|
|
168
|
+
if (valueType !== "object") {
|
|
169
|
+
return valueType;
|
|
170
|
+
}
|
|
171
|
+
if (seen.has(value)) {
|
|
172
|
+
return '"[Circular]"';
|
|
173
|
+
}
|
|
174
|
+
seen.add(value);
|
|
175
|
+
if (Array.isArray(value)) {
|
|
176
|
+
const serialized = `[${value.map((entry) => stableSerialize(entry, depth + 1, seen)).join(",")}]`;
|
|
177
|
+
seen.delete(value);
|
|
178
|
+
return serialized;
|
|
179
|
+
}
|
|
180
|
+
const entries = Object.entries(value)
|
|
181
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
182
|
+
.map(([key, entryValue]) => `${JSON.stringify(key)}:${stableSerialize(entryValue, depth + 1, seen)}`);
|
|
183
|
+
const serialized = `{${entries.join(",")}}`;
|
|
184
|
+
seen.delete(value);
|
|
185
|
+
return serialized;
|
|
186
|
+
}
|
|
187
|
+
function isPlainObject(value) {
|
|
188
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
const prototype = Object.getPrototypeOf(value);
|
|
192
|
+
return prototype === Object.prototype || prototype === null;
|
|
193
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { HonuaRequestInterceptor } from "../core/types.js";
|
|
2
|
+
export type EsriUrlPattern = string | RegExp;
|
|
3
|
+
export interface EsriRequestOptionsLike {
|
|
4
|
+
method?: string;
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
body?: BodyInit | null;
|
|
7
|
+
}
|
|
8
|
+
export interface EsriBeforeRequestParams {
|
|
9
|
+
url: string;
|
|
10
|
+
requestOptions: EsriRequestOptionsLike;
|
|
11
|
+
}
|
|
12
|
+
export interface EsriRequestInterceptorCompat {
|
|
13
|
+
urls?: EsriUrlPattern | readonly EsriUrlPattern[];
|
|
14
|
+
before?(params: EsriBeforeRequestParams): void | Promise<void>;
|
|
15
|
+
after?(response: Response): void | Promise<void>;
|
|
16
|
+
error?(error: unknown): void | Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export interface ArcGisTokenInterceptorOptions {
|
|
19
|
+
getToken(): string | undefined | Promise<string | undefined>;
|
|
20
|
+
applyTo?: EsriUrlPattern | readonly EsriUrlPattern[];
|
|
21
|
+
mode?: "query" | "bearer";
|
|
22
|
+
queryParamName?: string;
|
|
23
|
+
headerName?: string;
|
|
24
|
+
bearerPrefix?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface EsriRequestInterceptorHandle {
|
|
27
|
+
remove(): void;
|
|
28
|
+
}
|
|
29
|
+
export declare function createEsriRequestInterceptors(interceptors: readonly EsriRequestInterceptorCompat[]): HonuaRequestInterceptor[];
|
|
30
|
+
export declare class EsriRequestInterceptorRegistry {
|
|
31
|
+
private readonly interceptorsInternal;
|
|
32
|
+
constructor(initialInterceptors?: readonly EsriRequestInterceptorCompat[]);
|
|
33
|
+
get interceptors(): readonly EsriRequestInterceptorCompat[];
|
|
34
|
+
add(interceptor: EsriRequestInterceptorCompat): EsriRequestInterceptorHandle;
|
|
35
|
+
remove(interceptor: EsriRequestInterceptorCompat): boolean;
|
|
36
|
+
clear(): void;
|
|
37
|
+
toHonuaInterceptors(): HonuaRequestInterceptor[];
|
|
38
|
+
asHonuaInterceptor(): HonuaRequestInterceptor;
|
|
39
|
+
}
|
|
40
|
+
export declare function createArcGisTokenInterceptor(options: ArcGisTokenInterceptorOptions): HonuaRequestInterceptor;
|
|
41
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAuB,uBAAuB,EAAqC,MAAM,kBAAkB,CAAC;AAExH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,sBAAsB,CAAC;CACxC;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,CAAC,EAAE,cAAc,GAAG,SAAS,cAAc,EAAE,CAAC;IAClD,MAAM,CAAC,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,KAAK,CAAC,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,KAAK,CAAC,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,IAAI,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7D,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,cAAc,EAAE,CAAC;IACrD,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,IAAI,IAAI,CAAC;CAChB;AAID,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,SAAS,4BAA4B,EAAE,GACpD,uBAAuB,EAAE,CAE3B;AAED,qBAAa,8BAA8B;IACzC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAiC;gBAEnD,mBAAmB,GAAE,SAAS,4BAA4B,EAAO;IAIpF,IAAW,YAAY,IAAI,SAAS,4BAA4B,EAAE,CAEjE;IAEM,GAAG,CAAC,WAAW,EAAE,4BAA4B,GAAG,4BAA4B;IAS5E,MAAM,CAAC,WAAW,EAAE,4BAA4B,GAAG,OAAO;IAS1D,KAAK,IAAI,IAAI;IAIb,mBAAmB,IAAI,uBAAuB,EAAE;IAIhD,kBAAkB,IAAI,uBAAuB;CA0CrD;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,6BAA6B,GAAG,uBAAuB,CAiC5G"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
const VALID_QUERY_METHODS = new Set(["GET", "POST", "PUT", "PATCH", "DELETE"]);
|
|
2
|
+
export function createEsriRequestInterceptors(interceptors) {
|
|
3
|
+
return interceptors.map((interceptor) => createHonuaInterceptorFromEsri(interceptor));
|
|
4
|
+
}
|
|
5
|
+
export class EsriRequestInterceptorRegistry {
|
|
6
|
+
interceptorsInternal;
|
|
7
|
+
constructor(initialInterceptors = []) {
|
|
8
|
+
this.interceptorsInternal = [...initialInterceptors];
|
|
9
|
+
}
|
|
10
|
+
get interceptors() {
|
|
11
|
+
return [...this.interceptorsInternal];
|
|
12
|
+
}
|
|
13
|
+
add(interceptor) {
|
|
14
|
+
this.interceptorsInternal.push(interceptor);
|
|
15
|
+
return {
|
|
16
|
+
remove: () => {
|
|
17
|
+
this.remove(interceptor);
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
remove(interceptor) {
|
|
22
|
+
const index = this.interceptorsInternal.indexOf(interceptor);
|
|
23
|
+
if (index < 0) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
this.interceptorsInternal.splice(index, 1);
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
clear() {
|
|
30
|
+
this.interceptorsInternal.length = 0;
|
|
31
|
+
}
|
|
32
|
+
toHonuaInterceptors() {
|
|
33
|
+
return createEsriRequestInterceptors(this.interceptorsInternal);
|
|
34
|
+
}
|
|
35
|
+
asHonuaInterceptor() {
|
|
36
|
+
return {
|
|
37
|
+
before: async (context) => {
|
|
38
|
+
let currentContext = cloneRequestContext(context);
|
|
39
|
+
let applied = false;
|
|
40
|
+
for (const interceptor of this.interceptorsInternal) {
|
|
41
|
+
if (!interceptor.before || !matchesPattern(currentContext.url, interceptor.urls)) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const params = toEsriBeforeRequestParams(currentContext);
|
|
45
|
+
await interceptor.before(params);
|
|
46
|
+
const mutation = fromEsriBeforeRequestParams(currentContext, params);
|
|
47
|
+
currentContext = applyMutationToContext(currentContext, mutation);
|
|
48
|
+
applied = true;
|
|
49
|
+
}
|
|
50
|
+
return applied
|
|
51
|
+
? {
|
|
52
|
+
url: currentContext.url,
|
|
53
|
+
method: currentContext.method,
|
|
54
|
+
init: currentContext.init,
|
|
55
|
+
}
|
|
56
|
+
: undefined;
|
|
57
|
+
},
|
|
58
|
+
after: async (context) => {
|
|
59
|
+
for (const interceptor of this.interceptorsInternal) {
|
|
60
|
+
if (!interceptor.after || !matchesPattern(context.request.url, interceptor.urls)) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
await interceptor.after(context.response);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
error: async (context) => {
|
|
67
|
+
for (const interceptor of this.interceptorsInternal) {
|
|
68
|
+
if (!interceptor.error || !matchesPattern(context.request.url, interceptor.urls)) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
await interceptor.error(context.error);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export function createArcGisTokenInterceptor(options) {
|
|
78
|
+
const mode = options.mode ?? "query";
|
|
79
|
+
const queryParamName = options.queryParamName ?? "token";
|
|
80
|
+
const headerName = options.headerName ?? "Authorization";
|
|
81
|
+
const bearerPrefix = options.bearerPrefix ?? "Bearer";
|
|
82
|
+
return {
|
|
83
|
+
before: async (context) => {
|
|
84
|
+
if (!matchesPattern(context.url, options.applyTo)) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
const token = await options.getToken();
|
|
88
|
+
if (!token) {
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
if (mode === "query") {
|
|
92
|
+
return {
|
|
93
|
+
url: setQueryParam(context.url, queryParamName, token),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const headers = headersToRecord(context.init.headers);
|
|
97
|
+
headers[headerName] = bearerPrefix.trim().length > 0 ? `${bearerPrefix} ${token}` : token;
|
|
98
|
+
return {
|
|
99
|
+
init: {
|
|
100
|
+
...context.init,
|
|
101
|
+
headers,
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function normalizeMethod(method, fallback) {
|
|
108
|
+
if (typeof method !== "string") {
|
|
109
|
+
return fallback;
|
|
110
|
+
}
|
|
111
|
+
const upper = method.trim().toUpperCase();
|
|
112
|
+
if (VALID_QUERY_METHODS.has(upper)) {
|
|
113
|
+
return upper;
|
|
114
|
+
}
|
|
115
|
+
return fallback;
|
|
116
|
+
}
|
|
117
|
+
function createHonuaInterceptorFromEsri(interceptor) {
|
|
118
|
+
return {
|
|
119
|
+
before: async (context) => {
|
|
120
|
+
if (!matchesPattern(context.url, interceptor.urls) || !interceptor.before) {
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
const params = toEsriBeforeRequestParams(context);
|
|
124
|
+
await interceptor.before(params);
|
|
125
|
+
return fromEsriBeforeRequestParams(context, params);
|
|
126
|
+
},
|
|
127
|
+
after: async (context) => {
|
|
128
|
+
if (!matchesPattern(context.request.url, interceptor.urls)) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
await interceptor.after?.(context.response);
|
|
132
|
+
},
|
|
133
|
+
error: async (context) => {
|
|
134
|
+
if (!matchesPattern(context.request.url, interceptor.urls)) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
await interceptor.error?.(context.error);
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function toEsriBeforeRequestParams(context) {
|
|
142
|
+
return {
|
|
143
|
+
url: context.url,
|
|
144
|
+
requestOptions: {
|
|
145
|
+
method: context.method,
|
|
146
|
+
headers: headersToRecord(context.init.headers),
|
|
147
|
+
body: context.init.body,
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
function fromEsriBeforeRequestParams(context, params) {
|
|
152
|
+
const method = normalizeMethod(params.requestOptions.method, context.method);
|
|
153
|
+
return {
|
|
154
|
+
url: params.url,
|
|
155
|
+
method,
|
|
156
|
+
init: {
|
|
157
|
+
...context.init,
|
|
158
|
+
method,
|
|
159
|
+
headers: params.requestOptions.headers,
|
|
160
|
+
body: params.requestOptions.body,
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function applyMutationToContext(context, mutation) {
|
|
165
|
+
const method = mutation.method ?? context.method;
|
|
166
|
+
const nextInit = mutation.init === undefined
|
|
167
|
+
? context.init
|
|
168
|
+
: {
|
|
169
|
+
...context.init,
|
|
170
|
+
...mutation.init,
|
|
171
|
+
method,
|
|
172
|
+
};
|
|
173
|
+
return {
|
|
174
|
+
...context,
|
|
175
|
+
url: mutation.url ?? context.url,
|
|
176
|
+
method,
|
|
177
|
+
init: nextInit,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
function cloneRequestContext(context) {
|
|
181
|
+
return {
|
|
182
|
+
...context,
|
|
183
|
+
init: {
|
|
184
|
+
...context.init,
|
|
185
|
+
headers: headersToRecord(context.init.headers),
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function matchesPattern(url, pattern) {
|
|
190
|
+
if (!pattern) {
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
const patterns = Array.isArray(pattern) ? pattern : [pattern];
|
|
194
|
+
return patterns.some((candidate) => typeof candidate === "string" ? matchesStringPattern(url, candidate) : matchesRegExpPattern(url, candidate));
|
|
195
|
+
}
|
|
196
|
+
function matchesStringPattern(url, pattern) {
|
|
197
|
+
if (!pattern) {
|
|
198
|
+
return true;
|
|
199
|
+
}
|
|
200
|
+
if (url === pattern) {
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
const escapedPattern = pattern.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
204
|
+
const boundaryRegex = new RegExp(`${escapedPattern}(?=$|[/?#])`, "g");
|
|
205
|
+
return boundaryRegex.test(url);
|
|
206
|
+
}
|
|
207
|
+
function matchesRegExpPattern(url, pattern) {
|
|
208
|
+
if (!pattern.global && !pattern.sticky) {
|
|
209
|
+
return pattern.test(url);
|
|
210
|
+
}
|
|
211
|
+
pattern.lastIndex = 0;
|
|
212
|
+
const matched = pattern.test(url);
|
|
213
|
+
pattern.lastIndex = 0;
|
|
214
|
+
return matched;
|
|
215
|
+
}
|
|
216
|
+
function headersToRecord(headers) {
|
|
217
|
+
if (!headers) {
|
|
218
|
+
return {};
|
|
219
|
+
}
|
|
220
|
+
const record = {};
|
|
221
|
+
if (headers instanceof Headers) {
|
|
222
|
+
for (const [key, value] of headers.entries()) {
|
|
223
|
+
record[key] = value;
|
|
224
|
+
}
|
|
225
|
+
return record;
|
|
226
|
+
}
|
|
227
|
+
if (Array.isArray(headers)) {
|
|
228
|
+
for (const [key, value] of headers) {
|
|
229
|
+
record[key] = value;
|
|
230
|
+
}
|
|
231
|
+
return record;
|
|
232
|
+
}
|
|
233
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
234
|
+
if (value === undefined) {
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
record[key] = String(value);
|
|
238
|
+
}
|
|
239
|
+
return record;
|
|
240
|
+
}
|
|
241
|
+
function setQueryParam(urlText, key, value) {
|
|
242
|
+
const hashIndex = urlText.indexOf("#");
|
|
243
|
+
const hash = hashIndex >= 0 ? urlText.slice(hashIndex) : "";
|
|
244
|
+
const withoutHash = hashIndex >= 0 ? urlText.slice(0, hashIndex) : urlText;
|
|
245
|
+
const queryIndex = withoutHash.indexOf("?");
|
|
246
|
+
const path = queryIndex >= 0 ? withoutHash.slice(0, queryIndex) : withoutHash;
|
|
247
|
+
const existingQuery = queryIndex >= 0 ? withoutHash.slice(queryIndex + 1) : "";
|
|
248
|
+
const params = new URLSearchParams(existingQuery);
|
|
249
|
+
params.set(key, value);
|
|
250
|
+
const nextQuery = params.toString();
|
|
251
|
+
const withQuery = nextQuery.length > 0 ? `${path}?${nextQuery}` : path;
|
|
252
|
+
return `${withQuery}${hash}`;
|
|
253
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { CompatEventBus } from "./event-bus.js";
|
|
2
|
+
export interface RouteStopCompat {
|
|
3
|
+
name?: string;
|
|
4
|
+
location: [number, number];
|
|
5
|
+
}
|
|
6
|
+
export interface RouteSolveResultCompat {
|
|
7
|
+
path: [number, number][];
|
|
8
|
+
totalLengthMeters: number;
|
|
9
|
+
totalTimeSeconds: number;
|
|
10
|
+
}
|
|
11
|
+
export interface RouteLayerCompatOptions {
|
|
12
|
+
id?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
visible?: boolean;
|
|
16
|
+
opacity?: number;
|
|
17
|
+
listMode?: "show" | "hide";
|
|
18
|
+
stops?: readonly RouteStopCompat[];
|
|
19
|
+
autoSolve?: boolean;
|
|
20
|
+
routeProvider?: (stops: readonly RouteStopCompat[], options: RouteLayerCompat) => Promise<RouteSolveResultCompat> | RouteSolveResultCompat;
|
|
21
|
+
eventBus?: CompatEventBus;
|
|
22
|
+
}
|
|
23
|
+
export type RouteLayerLoadStatusCompat = "not-loaded" | "loading" | "loaded";
|
|
24
|
+
export interface RouteLayerHandleCompat {
|
|
25
|
+
remove(): void;
|
|
26
|
+
}
|
|
27
|
+
export declare class RouteLayerCompat {
|
|
28
|
+
readonly type: "route";
|
|
29
|
+
id: string | undefined;
|
|
30
|
+
title: string | undefined;
|
|
31
|
+
url: string | undefined;
|
|
32
|
+
visible: boolean;
|
|
33
|
+
opacity: number;
|
|
34
|
+
listMode: "show" | "hide";
|
|
35
|
+
readonly eventBus: CompatEventBus;
|
|
36
|
+
route: RouteSolveResultCompat | undefined;
|
|
37
|
+
readonly autoSolve: boolean;
|
|
38
|
+
solving: boolean;
|
|
39
|
+
loaded: boolean;
|
|
40
|
+
loadStatus: RouteLayerLoadStatusCompat;
|
|
41
|
+
private readonly stopsInternal;
|
|
42
|
+
private readonly routeProvider;
|
|
43
|
+
private readonly watchListeners;
|
|
44
|
+
constructor(options?: RouteLayerCompatOptions);
|
|
45
|
+
get stops(): readonly RouteStopCompat[];
|
|
46
|
+
load(): Promise<RouteLayerCompat>;
|
|
47
|
+
watch(propertyName: string, listener: (value: unknown) => void): RouteLayerHandleCompat;
|
|
48
|
+
addStop(stop: RouteStopCompat, index?: number): void;
|
|
49
|
+
addStops(stops: readonly RouteStopCompat[], index?: number): void;
|
|
50
|
+
clearStops(): void;
|
|
51
|
+
solve(): Promise<RouteSolveResultCompat | undefined>;
|
|
52
|
+
refresh(): Promise<RouteSolveResultCompat | undefined>;
|
|
53
|
+
when(callback?: (layer: RouteLayerCompat) => void): Promise<RouteLayerCompat>;
|
|
54
|
+
destroy(): void;
|
|
55
|
+
setVisibility(visible: boolean): void;
|
|
56
|
+
setOpacity(opacity: number): void;
|
|
57
|
+
private notifyWatchers;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=route-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-layer.d.ts","sourceRoot":"","sources":["../../../src/esri-compat/route-layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAmD,MAAM,gBAAgB,CAAC;AAEjG,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,SAAS,eAAe,EAAE,EACjC,OAAO,EAAE,gBAAgB,KACtB,OAAO,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,CAAC;IAC9D,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,MAAM,0BAA0B,GAAG,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE7E,MAAM,WAAW,sBAAsB;IACrC,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,qBAAa,gBAAgB;IAC3B,SAAgB,IAAI,EAAE,OAAO,CAAC;IACvB,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,SAAgB,QAAQ,EAAE,cAAc,CAAC;IAClC,KAAK,EAAE,sBAAsB,GAAG,SAAS,CAAC;IACjD,SAAgB,SAAS,EAAE,OAAO,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,0BAA0B,CAAC;IAE9C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoB;IAClD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAGgC;IAC9D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6C;gBAEzD,OAAO,GAAE,uBAA4B;IAmBxD,IAAW,KAAK,IAAI,SAAS,eAAe,EAAE,CAE7C;IAEY,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAgBvC,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,sBAAsB;IAevF,OAAO,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAqBpD,QAAQ,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAsBjE,UAAU,IAAI,IAAI;IAaZ,KAAK,IAAI,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;IA+BpD,OAAO,IAAI,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;IAItD,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAQnF,OAAO,IAAI,IAAI;IAKf,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAMrC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAMxC,OAAO,CAAC,cAAc;CAUvB"}
|