@vertigis/arcgis-extensions 49.9.0 → 50.0.1
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/AppConfig.schema.json +23 -6
- package/Hyperlink.d.ts +3 -1
- package/Hyperlink.js +1 -1
- package/data/ArcGISServiceTableExtension.js +1 -1
- package/data/Feature.d.ts +1 -3
- package/data/Feature.js +1 -1
- package/data/FeatureSet.d.ts +40 -2
- package/data/FeatureSet.js +1 -1
- package/data/FeatureSettings.js +1 -1
- package/data/FeatureSourceBase.d.ts +22 -27
- package/data/FeatureSourceBase.js +1 -1
- package/data/FieldExtension.d.ts +0 -3
- package/data/FieldExtension.js +1 -1
- package/data/PopupContentExtension.js +1 -1
- package/data/Schema.js +1 -1
- package/data/_Relationship.d.ts +1 -2
- package/data/_TableExtension.d.ts +1 -1
- package/data/_TableExtension.js +1 -1
- package/docs/html/assets/highlight.css +38 -10
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/Entity.EntityBase.html +12 -74
- package/docs/html/classes/Hyperlink.Hyperlink.html +10 -72
- package/docs/html/classes/LanguageResources.LanguageResources.html +36 -30
- package/docs/html/classes/data_ArcGISServiceTableExtension.ArcGISServiceTableExtension.html +35 -97
- package/docs/html/classes/data_Attachment.Attachment.html +12 -74
- package/docs/html/classes/data_Feature.Feature.html +16 -76
- package/docs/html/classes/data_FeatureList.FeatureList.html +73 -17
- package/docs/html/classes/data_FeatureSet.FeatureSet.html +39 -33
- package/docs/html/classes/data_FeatureSettings.FeatureSettings.html +11 -71
- package/docs/html/classes/data_FeatureSourceBase.FeatureSourceBase.html +35 -98
- package/docs/html/classes/data_FeatureSourceBase.RelationshipCollection.html +72 -16
- package/docs/html/classes/data_FeatureStream.FeatureStream.html +13 -75
- package/docs/html/classes/data_FieldExtension.FieldExtension.html +13 -75
- package/docs/html/classes/data_PopupContentExtension.PopupContentExtension.html +13 -75
- package/docs/html/classes/data_RelationshipBase.RelationshipBase.html +37 -31
- package/docs/html/classes/data_Schema.Schema.html +13 -73
- package/docs/html/classes/data_TaskSettings.TaskSettings.html +12 -72
- package/docs/html/classes/data__TableExtension.TableExtension.html +34 -96
- package/docs/html/classes/data__TableExtension.TableFeatureSettings.html +11 -71
- package/docs/html/classes/data__TableExtension.TableSchema.html +15 -75
- package/docs/html/classes/layer_preset_LayerPreset.LayerPreset.html +14 -76
- package/docs/html/classes/layer_preset_LayerPresetSettings.LayerPresetSetting.html +36 -30
- package/docs/html/classes/mapping_ArcGISSublayerExtension.ArcGISSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_ArcGISSublayerExtension.ArcGISSublayerRelationshipCollection.html +72 -16
- package/docs/html/classes/mapping_BasemapExtension.BasemapExtension.html +14 -76
- package/docs/html/classes/mapping_Bookmark.Bookmark.html +12 -74
- package/docs/html/classes/mapping_BuildingComponentSublayerExtension.BuildingComponentSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_BuildingComponentSublayerExtension.BuildingComponentSublayerSchema.html +13 -73
- package/docs/html/classes/mapping_BuildingGroupSublayerExtension.BuildingGroupSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_BuildingGroupSublayerExtension.BuildingGroupSublayerSchema.html +13 -73
- package/docs/html/classes/mapping_BuildingSceneLayerExtension.BuildingSceneLayerExtension.html +35 -97
- package/docs/html/classes/mapping_BuildingSceneLayerExtension.BuildingSceneLayerReadOnlySchema.html +13 -73
- package/docs/html/classes/mapping_BuildingSublayerExtension.BuildingSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_BuildingSublayerExtension.BuildingSublayerFeatureSettings.html +11 -53
- package/docs/html/classes/mapping_BuildingSublayerExtension.BuildingSublayerSchema.html +13 -73
- package/docs/html/classes/mapping_CSVLayerExtension.CSVLayerExtension.html +35 -97
- package/docs/html/classes/mapping_ElevationLayerExtension.ElevationLayerExtension.html +35 -97
- package/docs/html/classes/mapping_FeatureCollectionLayerExtension.FeatureCollectionLayerExtension.html +35 -97
- package/docs/html/classes/mapping_FeatureLayerExtension.FeatureLayerExtension.html +35 -97
- package/docs/html/classes/mapping_FeatureLayerExtensionBase.FeatureLayerExtensionBase.html +35 -97
- package/docs/html/classes/mapping_FeatureLayerExtensionBase.FeatureLayerReadOnlySchema.html +13 -73
- package/docs/html/classes/mapping_FeatureLayerExtensionBase.FeatureLayerSchema.html +13 -73
- package/docs/html/classes/mapping_GeoJSONLayerExtension.GeoJSONLayerExtension.html +35 -97
- package/docs/html/classes/mapping_GeoRSSLayerExtension.GeoRSSLayerExtension.html +35 -97
- package/docs/html/classes/mapping_GraphicsLayerExtension.GraphicsLayerExtension.html +35 -97
- package/docs/html/classes/mapping_GroundExtension.GroundExtension.html +13 -75
- package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtension.html +35 -97
- package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtensionCollection.html +74 -23
- package/docs/html/classes/mapping_ImageryLayerExtension.ImageryLayerExtension.html +35 -97
- package/docs/html/classes/mapping_ImageryTileLayerExtension.ImageryTileLayerExtension.html +35 -97
- package/docs/html/classes/mapping_IntegratedMeshLayerExtension.IntegratedMeshLayerExtension.html +35 -97
- package/docs/html/classes/mapping_KMLLayerExtension.KMLLayerExtension.html +35 -97
- package/docs/html/classes/mapping_KMLSublayerExtension.KMLSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_MapConstraints.MapConstraints.html +12 -72
- package/docs/html/classes/mapping_MapExtension.MapExtension.html +13 -75
- package/docs/html/classes/mapping_MapImageLayerExtension.MapImageLayerExtension.html +35 -97
- package/docs/html/classes/mapping_MapImageSublayerExtension.MapImageSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_MapNotesLayerExtension.MapNotesLayerExtension.html +35 -97
- package/docs/html/classes/mapping_MapNotesSublayerExtension.MapNotesSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_MapNotesSublayerExtension.MapNotesSublayerExtensionSchema.html +13 -73
- package/docs/html/classes/mapping_MediaLayerExtension.MediaLayerExtension.html +35 -97
- package/docs/html/classes/mapping_OpenStreetMapLayerExtension.OpenStreetMapLayerExtension.html +35 -97
- package/docs/html/classes/mapping_PointCloudLayerExtension.PointCloudLayerExtension.html +35 -97
- package/docs/html/classes/mapping_RouteLayerExtension.RouteLayerExtension.html +35 -97
- package/docs/html/classes/mapping_RouteLayerExtension.RouteLayerExtensionSchema.html +13 -73
- package/docs/html/classes/mapping_SceneLayerExtension.SceneLayerExtension.html +35 -97
- package/docs/html/classes/mapping_StreamLayerExtension.StreamLayerExtension.html +35 -97
- package/docs/html/classes/mapping_StreamLayerExtension.StreamLayerSchema.html +13 -73
- package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerExtension.html +35 -97
- package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerRelationshipCollection.html +72 -16
- package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerSchema.html +13 -73
- package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerRelationshipCollection.html +72 -16
- package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerSchema.html +13 -73
- package/docs/html/classes/mapping_TileLayerExtension.TileLayerExtension.html +35 -97
- package/docs/html/classes/mapping_TileSublayerExtension.TileSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_UnsupportedLayerExtension.UnsupportedLayerExtension.html +35 -97
- package/docs/html/classes/mapping_VectorTileLayerExtension.VectorTileLayerExtension.html +35 -97
- package/docs/html/classes/mapping_WFSLayerExtension.WFSLayerExtension.html +35 -97
- package/docs/html/classes/mapping_WMSLayerExtension.WMSLayerExtension.html +35 -97
- package/docs/html/classes/mapping_WMSSublayerExtension.WMSSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_WMTSLayerExtension.WMTSLayerExtension.html +35 -97
- package/docs/html/classes/mapping_WebTileLayerExtension.WebTileLayerExtension.html +35 -97
- package/docs/html/classes/mapping__LayerExtension.LayerExtension.html +35 -97
- package/docs/html/classes/mapping__LayerExtension.LayerExtensionReadOnlySchema.html +13 -73
- package/docs/html/classes/mapping__LayerExtension.LayerExtensionSchema.html +13 -73
- package/docs/html/classes/mapping__LayerExtensionCollectionImpl.LayerExtensionCollectionImpl.html +74 -23
- package/docs/html/classes/mapping__SublayerExtension.SubSublayerExtensionCollection.html +74 -23
- package/docs/html/classes/mapping__SublayerExtension.SublayerExtension.html +35 -97
- package/docs/html/classes/mapping__SublayerExtension.SublayerSchema.html +13 -73
- package/docs/html/classes/mapping_support_ArrayWrappedCollection.ArrayWrappedCollection.html +72 -16
- package/docs/html/classes/mapping_support_LayerListSettings.ExtensionBaseLayerListSettings.html +9 -71
- package/docs/html/classes/mapping_support_LayerListSettings.LayerListSettings.html +10 -72
- package/docs/html/classes/mapping_support__LayerExtensionCollection.LayerExtensionCollectionBase.html +77 -26
- package/docs/html/classes/mapping_support__SublayerExtensionCollection.SublayerExtensionCollectionBase.html +77 -26
- package/docs/html/classes/menus_Menu.Menu.html +13 -75
- package/docs/html/classes/menus_MenuItem.MenuItem.html +13 -75
- package/docs/html/classes/support_FormatSettings.FormatSettings.html +12 -72
- package/docs/html/classes/support_InitializableBase.InitializableBase.html +21 -83
- package/docs/html/classes/support_InitializableCollectionProxy.InitializableCollectionProxy.html +73 -17
- package/docs/html/classes/support_Observable.Observable.html +27 -26
- package/docs/html/classes/support_ReadOnlyInitializableCollection.ReadOnlyInitializableCollection.html +73 -17
- package/docs/html/classes/support_Serializable.SerializableBase.html +38 -32
- package/docs/html/classes/support_Settings.Settings.html +15 -75
- package/docs/html/classes/support__ArcGISRelationshipCollection.ArcGISRelationshipCollection.html +72 -16
- package/docs/html/classes/support_observableUtils.ObservableMixin.html +3 -0
- package/docs/html/classes/tasks_geocoding_ArcGISGeocoder.ArcGISGeocoder.html +35 -97
- package/docs/html/classes/tasks_geocoding_Geocoder.Geocoder.html +33 -95
- package/docs/html/classes/tasks_identify_IdentifyService.IdentifyService.html +11 -73
- package/docs/html/classes/tasks_query_ArcGISRelationship.ArcGISRelationship.html +36 -30
- package/docs/html/classes/tasks_query_QueryBasedRelationship.QueryBasedRelationship.html +36 -30
- package/docs/html/classes/tasks_query_QueryService.QueryService.html +11 -73
- package/docs/html/classes/tasks_search_SearchService.SearchService.html +12 -74
- package/docs/html/classes/utilities_CaseInsensitiveObservableMap.CaseInsensitiveObservableMap.html +24 -27
- package/docs/html/classes/utilities_CollectionProxy.CollectionProxy.html +73 -17
- package/docs/html/classes/utilities_CopyOnWriteCollection.CopyOnWriteCollection.html +72 -16
- package/docs/html/classes/utilities_MapTransformCollection.MapTransformCollection.html +72 -16
- package/docs/html/classes/utilities_ObservableMap.ObservableMap.html +26 -32
- package/docs/html/classes/utilities_ObservableSet.ObservableSet.html +38 -32
- package/docs/html/classes/utilities_ObservableWeakSet.ObservableWeakSet.html +44 -42
- package/docs/html/classes/utilities_ReadOnlyCollection.ReadOnlyCollection.html +72 -16
- package/docs/html/classes/utilities_ReadOnlyMap.ReadOnlyMap.html +23 -29
- package/docs/html/classes/utilities_format_date.DateFormatter.html +37 -31
- package/docs/html/classes/utilities_format_number.NumberFormatter.html +37 -31
- package/docs/html/classes/utilities_format_time.TimeFormatter.html +37 -31
- package/docs/html/functions/support_Observable.deprecatedGetPropertyPath.html +7 -0
- package/docs/html/functions/support_Observable.deprecatedNotifyChange.html +5 -0
- package/docs/html/functions/support_Observable.deprecatedSet.html +9 -0
- package/docs/html/functions/support_Observable.deprecatedWatch.html +9 -0
- package/docs/html/functions/support_Observable.deprecatedWatchProperty.html +14 -0
- package/docs/html/functions/support_Observable.getPropertyByPath.html +3 -2
- package/docs/html/functions/support_observableUtils.createIHandle.html +8 -0
- package/docs/html/functions/support_observableUtils.notifyChange.html +8 -0
- package/docs/html/functions/support_observableUtils.observable-1.html +31 -0
- package/docs/html/functions/support_observableUtils.onWatch.html +14 -0
- package/docs/html/functions/support_observableUtils.once.html +11 -0
- package/docs/html/functions/support_observableUtils.watch.html +24 -0
- package/docs/html/functions/support_observableUtils.watchEach.html +33 -0
- package/docs/html/functions/support_observableUtils.watchEvent.html +12 -0
- package/docs/html/functions/support_observableUtils.when.html +9 -0
- package/docs/html/functions/support_observableUtils.whenOnce.html +9 -0
- package/docs/html/functions/utilities_checkArg.checkArg.html +1 -1
- package/docs/html/functions/utilities_watch.onCollectionPropertyChange.html +6 -1
- package/docs/html/functions/utilities_watch.watchCollectionPropertyEach.html +5 -4
- package/docs/html/functions/utilities_watch.watchEach.html +8 -6
- package/docs/html/hierarchy.html +1 -1
- package/docs/html/interfaces/data_ArcGISServiceTableExtension.ArcGISServiceTableExtensionProperties.html +1 -1
- package/docs/html/interfaces/data_Feature.PresentableAttributes.html +24 -30
- package/docs/html/interfaces/data_Schema.SchemaProperties.html +2 -2
- package/docs/html/interfaces/data__Relationship.Relationship-1.html +35 -29
- package/docs/html/interfaces/data__TableExtension.TableExtensionProperties.html +1 -1
- package/docs/html/interfaces/json_AnnotationLayerJson.AnnotationLayerJson.html +2 -2
- package/docs/html/interfaces/json_BasemapLayerJson.BasemapLayerJsonBase.html +2 -2
- package/docs/html/interfaces/json_BingLayerJson.BingLayerJson.html +2 -2
- package/docs/html/interfaces/json_BuildingSceneLayerJson.BuildingSceneLayerJson.html +2 -2
- package/docs/html/interfaces/json_CSVLayerJson.CSVLayerJson.html +2 -2
- package/docs/html/interfaces/json_FeatureLayerJson.FeatureLayerJson.html +2 -2
- package/docs/html/interfaces/json_GeoJSONLayerJson.GeoJSONLayerJson.html +2 -2
- package/docs/html/interfaces/json_GeoRSSLayerJson.GeoRSSLayerJson.html +2 -2
- package/docs/html/interfaces/json_GroupLayerJson.GroupLayerJson.html +2 -2
- package/docs/html/interfaces/json_ImageServiceLayerJson.ImageServiceLayerJson.html +2 -2
- package/docs/html/interfaces/json_ImageServiceVectorLayerJson.ImageServiceVectorLayerJson.html +2 -2
- package/docs/html/interfaces/json_IntegratedMeshLayerJson.IntegratedMeshLayerJson.html +2 -2
- package/docs/html/interfaces/json_ItemJson.ItemJson.html +2 -2
- package/docs/html/interfaces/json_KMLLayerJson.KMLLayerJson.html +2 -2
- package/docs/html/interfaces/json_LayerJson.LayerJsonBase.html +2 -2
- package/docs/html/interfaces/json_MapServiceLayerJson.MapServiceLayerJson.html +2 -2
- package/docs/html/interfaces/json_MediaLayerJson.MediaLayerJson.html +2 -2
- package/docs/html/interfaces/json_OpenStreetMapLayerJson.OpenStreetMapLayerJson.html +2 -2
- package/docs/html/interfaces/json_OperationalLayerJson.OperationalLayerJsonBase.html +2 -2
- package/docs/html/interfaces/json_PointCloudLayerJson.PointCloudLayerJson.html +2 -2
- package/docs/html/interfaces/json_RasterDataElevationLayerJson.RasterDataElevationLayerJson.html +2 -2
- package/docs/html/interfaces/json_SceneLayerJson.SceneLayerJson.html +2 -2
- package/docs/html/interfaces/json_StreamLayerJson.StreamLayerJson.html +2 -2
- package/docs/html/interfaces/json_SubtypeGroupLayerJson.SubtypeGroupLayerJson.html +2 -2
- package/docs/html/interfaces/json_SubtypeGroupLayerJson.SubtypeSubtypeGroupLayerJson.html +2 -2
- package/docs/html/interfaces/json_SubtypeSublayerJson.SubtypeSublayerJson.html +2 -2
- package/docs/html/interfaces/json_TiledElevationServiceLayerJson.TiledElevationServiceLayerJson.html +2 -2
- package/docs/html/interfaces/json_TiledImageServiceLayerJson.TiledImageServiceLayerJson.html +2 -2
- package/docs/html/interfaces/json_TiledMapServiceLayerJson.TiledMapServiceLayerJson.html +2 -2
- package/docs/html/interfaces/json_VectorTileLayerJson.VectorTileLayerJson.html +2 -2
- package/docs/html/interfaces/json_WFSLayerJson.WFSLayerJson.html +2 -2
- package/docs/html/interfaces/json_WMSLayerJson.WMSLayerJson.html +2 -2
- package/docs/html/interfaces/json_WebTileLayerJson.WebTileLayerJson.html +2 -2
- package/docs/html/interfaces/mapping_ArcGISSublayerExtension.ArcGISSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_BuildingComponentSublayerExtension.BuildingComponentSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_BuildingGroupSublayerExtension.BuildingGroupSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_BuildingSceneLayerExtension.BuildingSceneLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_BuildingSceneLayerExtension.BuildingSceneLayerProperties.html +2 -2
- package/docs/html/interfaces/mapping_BuildingSublayerExtension.BuildingSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_CSVLayerExtension.CSVLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_ElevationLayerExtension.ElevationLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_FeatureLayerExtension.FeatureLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_FeatureLayerExtension.FeatureLayerProperties.html +2 -2
- package/docs/html/interfaces/mapping_FeatureLayerExtensionBase.FeatureLayerBaseProperties.html +2 -2
- package/docs/html/interfaces/mapping_FeatureLayerExtensionBase.FeatureLayerExtensionBaseProperties.html +1 -1
- package/docs/html/interfaces/mapping_GeoJSONLayerExtension.GeoJSONLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_GeoRSSLayerExtension.GeoRSSLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_GraphicsLayerExtension.GraphicsLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_GroupLayerExtension.GroupLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_ImageryLayerExtension.ImageryLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_ImageryTileLayerExtension.ImageryTileLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_IntegratedMeshLayerExtension.IntegratedMeshLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_KMLLayerExtension.KMLLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_KMLSublayerExtension.KMLSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_MapExtension.MapExtensionProperties.html +3 -3
- package/docs/html/interfaces/mapping_MapImageLayerExtension.MapImageLayerExtensionProperties.html +4 -4
- package/docs/html/interfaces/mapping_MapImageSublayerExtension.MapImageSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_MapNotesLayerExtension.MapNotesLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_MapNotesSublayerExtension.MapNotesSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_MediaLayerExtension.MediaLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_OpenStreetMapLayerExtension.OpenStreetMapLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_PointCloudLayerExtension.PointCloudLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_PointCloudLayerExtension.PointCloudLayerProperties.html +2 -2
- package/docs/html/interfaces/mapping_RouteLayerExtension.RouteLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_SceneLayerExtension.SceneLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_StreamLayerExtension.StreamLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_SubtypeSublayerExtension.SubtypeSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_TileLayerExtension.TileLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_TileSublayerExtension.TileSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_VectorTileLayerExtension.VectorTileLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_WFSLayerExtension.WFSLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_WMSLayerExtension.WMSLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_WMSSublayerExtension.WMSSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_WMTSLayerExtension.WMTSLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_WebTileLayerExtension.WebTileLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping__LayerExtension.LayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping__SublayerExtension.SublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_support_ArrayWrappedCollection.ArrayWrappedCollectionProperties.html +3 -3
- package/docs/html/interfaces/support_InitializableBase.Initializable.html +1 -1
- package/docs/html/interfaces/support_Observable.IDeprecatedObservable.html +57 -0
- package/docs/html/interfaces/support_Serializable.Serializable.html +60 -5
- package/docs/html/interfaces/support_esri.SublayerLike.html +2 -29
- package/docs/html/interfaces/support_observableUtils.IHandle.html +9 -0
- package/docs/html/interfaces/support_observableUtils.WatchEachOptions.html +29 -0
- package/docs/html/interfaces/support_observableUtils.WatchOptions.html +26 -0
- package/docs/html/interfaces/utilities_collection.AfterItemChangeEvent.html +4 -0
- package/docs/html/modules/support_Observable.html +8 -2
- package/docs/html/modules/support_esri.html +4 -3
- package/docs/html/modules/support_observableUtils.html +20 -0
- package/docs/html/modules/utilities_ObservableWeakSet.html +1 -1
- package/docs/html/modules/utilities_collection.html +1 -0
- package/docs/html/modules/utilities_watch.html +4 -4
- package/docs/html/modules.html +1 -0
- package/docs/html/types/support_esri.CollectionAfterEvent.html +1 -0
- package/docs/html/types/support_esri.CollectionAfterItemEvent.html +1 -1
- package/docs/html/types/support_esri.CollectionEvent.html +1 -0
- package/docs/html/types/support_esri.CollectionItemEvent.html +1 -0
- package/docs/html/types/support_observableUtils.Observable.html +5 -0
- package/docs/html/types/support_observableUtils.ObservablePropertyPath.html +9 -0
- package/docs/html/types/support_observableUtils.TargetTypeFromPath.html +14 -0
- package/docs/html/types/support_observableUtils.ValueTypeFromPath.html +14 -0
- package/docs/html/types/support_observableUtils.WhenOptions.html +7 -0
- package/docs/html/types/utilities_watch.WatchCallback.html +3 -0
- package/docs/html/variables/version.version.html +1 -1
- package/layer-preset/LayerPreset.js +1 -1
- package/mapping/ArcGISSublayerExtension.js +1 -1
- package/mapping/BasemapExtension.d.ts +1 -1
- package/mapping/BasemapExtension.js +1 -1
- package/mapping/BuildingComponentSublayerExtension.js +1 -1
- package/mapping/CSVLayerExtension.js +1 -1
- package/mapping/FeatureLayerExtension.js +1 -1
- package/mapping/FeatureLayerExtensionBase.js +1 -1
- package/mapping/GeoJSONLayerExtension.js +1 -1
- package/mapping/GeoRSSLayerExtension.js +1 -1
- package/mapping/GraphicsLayerExtension.js +1 -1
- package/mapping/GroundExtension.js +1 -1
- package/mapping/GroupLayerExtension.js +1 -1
- package/mapping/ImageryLayerExtension.js +1 -1
- package/mapping/KMLLayerExtension.js +1 -1
- package/mapping/MapExtension.d.ts +1 -1
- package/mapping/MapExtension.js +1 -1
- package/mapping/MapNotesSublayerExtension.js +1 -1
- package/mapping/PointCloudLayerExtension.js +1 -1
- package/mapping/RouteLayerExtension.js +1 -1
- package/mapping/SceneLayerExtension.js +1 -1
- package/mapping/StreamLayerExtension.js +1 -1
- package/mapping/SubtypeGroupLayerExtension.js +1 -1
- package/mapping/SubtypeSublayerExtension.js +1 -1
- package/mapping/WFSLayerExtension.js +1 -1
- package/mapping/WMTSLayerExtension.js +1 -1
- package/mapping/_LayerExtension.js +1 -1
- package/mapping/_SublayerExtension.d.ts +1 -1
- package/mapping/_SublayerExtension.js +1 -1
- package/mapping/support/ArrayWrappedCollection.d.ts +3 -3
- package/mapping/support/ArrayWrappedCollection.js +1 -1
- package/mapping/support/LayerListSettings.d.ts +3 -1
- package/mapping/support/LayerListSettings.js +1 -1
- package/mapping/support/PopupTemplateFeatureSettings.js +1 -1
- package/mapping/support/_LayerExtensionCollection.d.ts +19 -4
- package/mapping/support/_LayerExtensionCollection.js +1 -1
- package/mapping/support/_SublayerExtensionCollection.d.ts +19 -4
- package/mapping/support/_SublayerExtensionCollection.js +1 -1
- package/package.json +1 -1
- package/portal/BuildingSceneLayer.js +1 -1
- package/portal/SubtypeGroupLayer.js +1 -1
- package/portal/WMSLayer.js +1 -1
- package/support/InitializableBase.d.ts +12 -3
- package/support/InitializableBase.js +1 -1
- package/support/InitializeError.js +1 -1
- package/support/Observable.d.ts +164 -14
- package/support/Observable.js +1 -1
- package/support/Serializable.d.ts +40 -3
- package/support/Serializable.js +1 -1
- package/support/Settings.d.ts +6 -7
- package/support/Settings.js +1 -1
- package/support/esri.d.ts +6 -52
- package/support/observableUtils.d.ts +560 -0
- package/support/observableUtils.js +1 -0
- package/tasks/geocoding/ArcGISGeocoder.js +1 -1
- package/tasks/query/ClientSideQueryProvider.js +1 -1
- package/utilities/CollectionProxy.d.ts +54 -23
- package/utilities/CollectionProxy.js +1 -1
- package/utilities/MapTransformCollection.js +1 -1
- package/utilities/ObservableMap.d.ts +35 -4
- package/utilities/ObservableMap.js +1 -1
- package/utilities/ObservableSet.d.ts +44 -3
- package/utilities/ObservableSet.js +1 -1
- package/utilities/ObservableWeakSet.d.ts +3 -0
- package/utilities/ReadOnlyMap.d.ts +15 -2
- package/utilities/ReadOnlyMap.js +1 -1
- package/utilities/collection.d.ts +9 -0
- package/utilities/collection.js +1 -1
- package/utilities/watch.d.ts +25 -7
- package/utilities/watch.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/docs/html/interfaces/support_esri.AccessorLike.html +0 -29
- package/docs/html/types/support_esri.WatchCallback.html +0 -3
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
import Accessor from "@arcgis/core/core/Accessor";
|
|
2
|
+
import Collection from "@arcgis/core/core/Collection.js";
|
|
3
|
+
import type Evented from "@arcgis/core/core/Evented.js";
|
|
4
|
+
import { type ObservableMap } from "../utilities/ObservableMap.js";
|
|
5
|
+
import type { ObservableSet } from "../utilities/ObservableSet.js";
|
|
6
|
+
/**
|
|
7
|
+
* Represents an observable object. This can be an esri class that extends
|
|
8
|
+
* Accessor and implements esri's property watch functionality or an object that
|
|
9
|
+
* has been made observable via the {@link support/observableUtils!observable}
|
|
10
|
+
* mixin.
|
|
11
|
+
*/
|
|
12
|
+
export type Observable = ObservableMixin | Accessor;
|
|
13
|
+
/**
|
|
14
|
+
* Represents an object that is collection like and can be observed. This can be
|
|
15
|
+
* an esri collection, an ObservableMap, or an ObservableSet.
|
|
16
|
+
*/
|
|
17
|
+
type ObservableCollectionLike<T> = Collection<T> | ObservableMap<any, T> | ObservableSet<T>;
|
|
18
|
+
/**
|
|
19
|
+
* Represents a path to a property on an observable or esri class with a base
|
|
20
|
+
* class of accessor. Only traverses to 3 levels deep.
|
|
21
|
+
*
|
|
22
|
+
* Examples:
|
|
23
|
+
*
|
|
24
|
+
* "foo" | "bar.baz" | "foo.bar.baz" | "foo.bar.baz.qux".
|
|
25
|
+
*
|
|
26
|
+
* Note: This is a complex recursive type that should only be used for function
|
|
27
|
+
* definitions related to the observable watch system. It is not intended to be
|
|
28
|
+
* used for general purposes and should not be used by casts or other type
|
|
29
|
+
* manipulations. Do not set the Depth type parameter.
|
|
30
|
+
*/
|
|
31
|
+
export type ObservablePropertyPath<T extends Observable, Depth extends number[] = []> = Depth["length"] extends 3 ? never : NestedObjectPaths<T, Depth>;
|
|
32
|
+
type NestedObjectPaths<T extends Observable, Depth extends number[]> = {
|
|
33
|
+
[K in Extract<keyof T, string>]-?: [NonNullable<T[K]>] extends [never] ? never : NonNullable<T[K]> extends Observable ? K | `${K}.${ObservablePropertyPath<NonNullable<T[K]>, [...Depth, 0]>}` : K;
|
|
34
|
+
}[Extract<keyof T, string>];
|
|
35
|
+
/**
|
|
36
|
+
* Represents a path to a property on an observable or esri class with a base
|
|
37
|
+
* class of accessor in a collection. Only traverse to 2 levels deep to the
|
|
38
|
+
* collection then 1 level into the object type in the collection.
|
|
39
|
+
*
|
|
40
|
+
* This will build paths into the objects of the collections if the collection
|
|
41
|
+
* is properly typed and contains observables or accessors. Collections are only
|
|
42
|
+
* supported at the first and second level of the path as well as being the root
|
|
43
|
+
* of the path. It is only possible to watch up to two properties deep into the
|
|
44
|
+
* object in a collection. This helps stave off some performance issues with the
|
|
45
|
+
* type system.
|
|
46
|
+
*
|
|
47
|
+
* Examples:
|
|
48
|
+
*
|
|
49
|
+
* "[].foo" | "[].foo.bar".
|
|
50
|
+
*
|
|
51
|
+
* "foo.[].bar" | "foo.[].bar.baz" | "foo.bar.[].baz" | "foo.bar.[].baz.qux".
|
|
52
|
+
*/
|
|
53
|
+
type CollectionPropertyPath<T extends Observable, Depth extends number[] = []> = Depth["length"] extends 2 ? never : T extends ObservableCollectionLike<infer ItemType> ? ItemType extends Observable ? `[].${DeepObjectPaths<ItemType>}` : never : NestedCollectionPropertyPath<T, Depth>;
|
|
54
|
+
type NestedCollectionPropertyPath<T, Depth extends number[]> = {
|
|
55
|
+
[K in Extract<keyof T, string>]-?: [NonNullable<T[K]>] extends [never] ? never : NonNullable<T[K]> extends ObservableCollectionLike<infer ItemType> ? ItemType extends Observable ? `${K}.[].${DeepObjectPaths<ItemType>}` : never : NonNullable<T[K]> extends Observable ? `${K}.${CollectionPropertyPath<NonNullable<T[K]>, [...Depth, 0]>}` : never;
|
|
56
|
+
}[Extract<keyof T, string>];
|
|
57
|
+
type DeepObjectPaths<T extends Observable> = {
|
|
58
|
+
[K in Extract<keyof T, string>]-?: [NonNullable<T[K]>] extends [never] ? never : K;
|
|
59
|
+
}[Extract<keyof T, string>];
|
|
60
|
+
/**
|
|
61
|
+
* The type of the value at the end of a path created from
|
|
62
|
+
* ObservablePropertyPath or CollectionPropertyPath. Only intended for use with
|
|
63
|
+
* ObservablePropertyPath or CollectionPropertyPath.
|
|
64
|
+
*
|
|
65
|
+
* Because the path was built with ObservablePropertyPath or
|
|
66
|
+
* CollectionPropertyPath, we know that the path is valid. We still have to
|
|
67
|
+
* build out the conditionals for the type system to understand what we are
|
|
68
|
+
* doing, but we don't need to handle the false cases.
|
|
69
|
+
*
|
|
70
|
+
* This type uses recursion without any depth limits because the path is
|
|
71
|
+
* guaranteed to be valid and of a limited depth.
|
|
72
|
+
*
|
|
73
|
+
* Note: This is a complex recursive type that should only be used for function
|
|
74
|
+
* definitions related to the observable watch system. It is not intended to be
|
|
75
|
+
* used for general purposes and should not be used by casts or other type
|
|
76
|
+
* manipulations.
|
|
77
|
+
*/
|
|
78
|
+
export type ValueTypeFromPath<T extends Observable, P extends string> = P extends keyof T ? T[P] : P extends `[].${infer ItemPath}` ? [
|
|
79
|
+
T
|
|
80
|
+
] extends [ObservableCollectionLike<infer ItemType>] ? ItemType extends Observable ? ItemPath extends keyof ItemType ? ItemType[ItemPath] : ValueTypeFromPath<ItemType, ItemPath> : unknown : unknown : P extends `${infer K}.${infer Rest}` ? K extends keyof T ? [T[K]] extends [Observable | undefined | null] ? Rest extends `[].${string}` ? ValueTypeFromPath<NonNullable<T[K]>, Rest> : // Keep recursing through the path to get the type of the
|
|
81
|
+
ValueTypeFromPath<NonNullable<T[K]>, Rest> | (undefined extends T[K] ? undefined : never) : unknown : unknown : unknown;
|
|
82
|
+
/**
|
|
83
|
+
* The type of the target at the second to last position of a path created from
|
|
84
|
+
* ObservablePropertyPath or CollectionPropertyPath. Only intended for use with
|
|
85
|
+
* ObservablePropertyPath or CollectionPropertyPath.
|
|
86
|
+
*
|
|
87
|
+
* Because the path was built with ObservablePropertyPath or
|
|
88
|
+
* CollectionPropertyPath, we know that the path is valid. We still have to
|
|
89
|
+
* build out the conditionals for the type system to understand what we are
|
|
90
|
+
* doing, but we don't need to handle the false cases.
|
|
91
|
+
*
|
|
92
|
+
* This type uses recursion without any depth limits because the path is
|
|
93
|
+
* guaranteed to be valid and of a limited depth.
|
|
94
|
+
*
|
|
95
|
+
* Note: This is a complex recursive type that should only be used for function
|
|
96
|
+
* definitions related to the observable watch system. It is not intended to be
|
|
97
|
+
* used for general purposes and should not be used by casts or other type
|
|
98
|
+
* manipulations.
|
|
99
|
+
*/
|
|
100
|
+
export type TargetTypeFromPath<T extends Observable, P extends string> = P extends keyof T ? T : P extends `[].${infer ItemPath}` ? [
|
|
101
|
+
T
|
|
102
|
+
] extends [ObservableCollectionLike<infer ItemType>] ? ItemType extends Observable ? ItemPath extends keyof ItemType ? ItemType : TargetTypeFromPath<ItemType, ItemPath> : unknown : unknown : P extends `${infer K}.${infer Rest}` ? K extends keyof T ? [T[K]] extends [Observable | undefined | null] ? Rest extends `[].${string}` ? TargetTypeFromPath<NonNullable<T[K]>, Rest> : // Keep recursing through the path to get the type of the
|
|
103
|
+
TargetTypeFromPath<NonNullable<T[K]>, Rest> | (undefined extends T[K] ? undefined : never) : unknown : unknown : T;
|
|
104
|
+
/**
|
|
105
|
+
* The type of the path to a property that is an evented object in an observable
|
|
106
|
+
* or esri class. Limits the depth of the path to 3 levels deep.
|
|
107
|
+
*/
|
|
108
|
+
type EventedPropertyPath<T extends Observable, Depth extends number[] = []> = Depth["length"] extends 3 ? never : NestedEventedPropertyPath<T, Depth>;
|
|
109
|
+
type NestedEventedPropertyPath<T extends Observable, Depth extends number[]> = {
|
|
110
|
+
[K in Extract<keyof T, string>]-?: [NonNullable<T[K]>] extends [never] ? never : NonNullable<T[K]> extends Observable ? (NonNullable<T[K]> extends Evented ? K : never) | `${K}.${EventedPropertyPath<NonNullable<T[K]>, [...Depth, 0]>}` : NonNullable<T[K]> extends Evented ? K : never;
|
|
111
|
+
}[Extract<keyof T, string>];
|
|
112
|
+
/**
|
|
113
|
+
* The type of the value at the end of a path created from EventedPropertyPath.
|
|
114
|
+
* Only intended for use with EventedPropertyPath.
|
|
115
|
+
*
|
|
116
|
+
* Because the path was built with ObservablePropertyPath, we know that the path
|
|
117
|
+
* is valid. We still have to build out the conditionals for the type system to
|
|
118
|
+
* understand what we are doing, but we don't need to handle the false cases.
|
|
119
|
+
*
|
|
120
|
+
* This type uses recursion without any depth limits because the path is
|
|
121
|
+
* guaranteed to be valid and of a limited depth.
|
|
122
|
+
*/
|
|
123
|
+
type EventedTypeFromPath<T extends Observable, P extends string> = P extends keyof T ? T[P] : P extends `${infer K}.${infer Rest}` ? K extends keyof T ? NonNullable<T[K]> extends Observable ? // Keep recursing through the path to get the type of the
|
|
124
|
+
EventedTypeFromPath<NonNullable<T[K]>, Rest> | (undefined extends T[K] ? undefined : never) : unknown : unknown : unknown;
|
|
125
|
+
type OverloadProps<TOverload> = Pick<TOverload, keyof TOverload>;
|
|
126
|
+
type OverloadUnionRecursive<TOverload, TPartialOverload = unknown> = TOverload extends (...args: infer TArgs) => infer TReturn ? TPartialOverload extends TOverload ? never : OverloadUnionRecursive<TPartialOverload & TOverload, TPartialOverload & ((...args: TArgs) => TReturn) & OverloadProps<TOverload>> | ((...args: TArgs) => TReturn) : never;
|
|
127
|
+
type OverloadUnion<TOverload extends (...args: any[]) => any> = Exclude<OverloadUnionRecursive<(() => never) & TOverload>, TOverload extends () => never ? never : () => never>;
|
|
128
|
+
type OverloadParameters<T extends (...args: any[]) => any> = Parameters<OverloadUnion<T>>;
|
|
129
|
+
/**
|
|
130
|
+
* Options for {@link support/observableUtils!watch}.
|
|
131
|
+
*/
|
|
132
|
+
export interface WatchOptions {
|
|
133
|
+
/**
|
|
134
|
+
* If true, the watch callback will be invoked immediately with the current
|
|
135
|
+
* value of the property being watched. Both the newValue and oldValue
|
|
136
|
+
* parameters will be set to the current value.
|
|
137
|
+
*
|
|
138
|
+
* If sync is also true, the callback invoked with the initial value will be
|
|
139
|
+
* synchronous. Otherwise it will be asynchronous.
|
|
140
|
+
*
|
|
141
|
+
* @default false
|
|
142
|
+
*/
|
|
143
|
+
initial?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* If true, the watch callback will be invoked synchronously. If false, the
|
|
146
|
+
* watch callback will be invoked asynchronously.
|
|
147
|
+
*
|
|
148
|
+
* @default false
|
|
149
|
+
*/
|
|
150
|
+
sync?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* If true, the watch callback will only be invoked once and then the remove
|
|
153
|
+
* handle will be called. If false, the watch callback will be invoked each
|
|
154
|
+
* time the watched property changes.
|
|
155
|
+
*
|
|
156
|
+
* If sync is also true, the callback will be invoked synchronously.
|
|
157
|
+
* Otherwise it will be asynchronous.
|
|
158
|
+
*
|
|
159
|
+
* @default false
|
|
160
|
+
*/
|
|
161
|
+
once?: boolean;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Options for {@link support/observableUtils!watchEach}.
|
|
165
|
+
*/
|
|
166
|
+
export interface WatchEachOptions extends WatchOptions {
|
|
167
|
+
/**
|
|
168
|
+
* If true, the watch callback will be invoked immediately for each object
|
|
169
|
+
* in the collection with the current value of the property being watched,
|
|
170
|
+
* as well as any item added to the collection. Both the newValue and
|
|
171
|
+
* oldValue parameters will be set to the current value of the object in the
|
|
172
|
+
* collection.
|
|
173
|
+
*
|
|
174
|
+
* If sync is also true, the callback invoked with the initial value will be
|
|
175
|
+
* synchronous. Otherwise it will be asynchronous.
|
|
176
|
+
*
|
|
177
|
+
* @default false
|
|
178
|
+
*/
|
|
179
|
+
initial?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* If true, the watch callback will be invoked once for each object in the
|
|
182
|
+
* collection as well as once for each item added to the collection. If
|
|
183
|
+
* false, the watch callback will be invoked each time the watched property
|
|
184
|
+
* changes for each item in the collection.
|
|
185
|
+
*
|
|
186
|
+
* If sync is also true, the callback will be invoked synchronously.
|
|
187
|
+
* Otherwise it will be asynchronous.
|
|
188
|
+
*
|
|
189
|
+
* @default false
|
|
190
|
+
*/
|
|
191
|
+
once?: boolean;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Options for {@link support/observableUtils!when}.
|
|
195
|
+
*/
|
|
196
|
+
export type WhenOptions = Omit<WatchOptions, "initial"> & {
|
|
197
|
+
/**
|
|
198
|
+
* If true, the when callback will be invoked if the value is falsy. If
|
|
199
|
+
* false, the when callback will be invoked if the value is truthy.
|
|
200
|
+
*
|
|
201
|
+
* @default false
|
|
202
|
+
*/
|
|
203
|
+
invert?: boolean;
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Returned by {@link support/observableUtils!watch}.
|
|
207
|
+
*
|
|
208
|
+
* Call `remove` to stop watching.
|
|
209
|
+
*/
|
|
210
|
+
export interface IHandle {
|
|
211
|
+
/**
|
|
212
|
+
* Stops watching the property.
|
|
213
|
+
*
|
|
214
|
+
* Any pending asynchronous callbacks (watch options used `sync: false`)
|
|
215
|
+
* that have not yet been invoked will also be stopped and not invoked. This
|
|
216
|
+
* includes the callback invoked with the initial value (watch options used
|
|
217
|
+
* `initial: true`).
|
|
218
|
+
*/
|
|
219
|
+
remove(): void;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Supporting mixin declaration for {@link support/observableUtils!observable}.
|
|
223
|
+
*/
|
|
224
|
+
export declare class ObservableMixin {
|
|
225
|
+
private readonly __isObservable;
|
|
226
|
+
private readonly _subscribedPaths;
|
|
227
|
+
private readonly _onWatchPaths;
|
|
228
|
+
private readonly _esriProps;
|
|
229
|
+
private _onWatch;
|
|
230
|
+
private _notifyChange;
|
|
231
|
+
private _watch;
|
|
232
|
+
private _recurseWatch;
|
|
233
|
+
private _recurseCollectionWatch;
|
|
234
|
+
private _collectionWatch;
|
|
235
|
+
private _watchSingle;
|
|
236
|
+
private _createWatchDescriptor;
|
|
237
|
+
private _createSingleWatchRemoveHandle;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Mixin to add observable functionality to a class.
|
|
241
|
+
*
|
|
242
|
+
* Observability allows you to watch for changes to properties on an object.
|
|
243
|
+
*
|
|
244
|
+
* Observability is handled by this mixin but if you have an accessor property
|
|
245
|
+
* that is backed by a backing field and that backing field is updated
|
|
246
|
+
* separately from the accessor set, you must call
|
|
247
|
+
* {@link support/observableUtils!notifyChange} for the accessor property after
|
|
248
|
+
* the backing field has changed to ensure watchers are notified of the change.
|
|
249
|
+
*
|
|
250
|
+
* The implementation of the mixin expects that accessor properties with a
|
|
251
|
+
* setter use the value given to the setter as the new value that will be
|
|
252
|
+
* returned by the getter.
|
|
253
|
+
*
|
|
254
|
+
* See {@link support/observableUtils!watch}.
|
|
255
|
+
*
|
|
256
|
+
* See {@link support/observableUtils!notifyChange}.
|
|
257
|
+
*
|
|
258
|
+
* See {@link support/observableUtils!onWatch}.
|
|
259
|
+
*
|
|
260
|
+
* See {@link support/observableUtils!watchEvent}.
|
|
261
|
+
*
|
|
262
|
+
* See {@link support/observableUtils!once}.
|
|
263
|
+
*
|
|
264
|
+
* Usage example of the mixin by wrapping a base class.
|
|
265
|
+
*
|
|
266
|
+
* ```ts
|
|
267
|
+
* class MyClass extends observable(BaseClass) {
|
|
268
|
+
* foo: string = "foo";
|
|
269
|
+
* }
|
|
270
|
+
*
|
|
271
|
+
* const myClass = new MyClass();
|
|
272
|
+
* watch(myClass, "foo", (newValue, oldValue) => {});
|
|
273
|
+
* ```
|
|
274
|
+
*
|
|
275
|
+
* Usage example of the mixin used as a base class.
|
|
276
|
+
*
|
|
277
|
+
* ```ts
|
|
278
|
+
* export class MyClass extends observable() {
|
|
279
|
+
* private _otherObservable: OtherObservable = new OtherObservable();
|
|
280
|
+
*
|
|
281
|
+
* get foo(): string {
|
|
282
|
+
* return this._otherObservable.foo;
|
|
283
|
+
* }
|
|
284
|
+
*
|
|
285
|
+
* constructor() {
|
|
286
|
+
* super();
|
|
287
|
+
*
|
|
288
|
+
* onWatch(this, "foo", () =>
|
|
289
|
+
* watch(this._otherObservable, "foo", () => {
|
|
290
|
+
* notifyChange(this, "foo");
|
|
291
|
+
* })
|
|
292
|
+
* );
|
|
293
|
+
* }
|
|
294
|
+
* }
|
|
295
|
+
* ```
|
|
296
|
+
*
|
|
297
|
+
* Usage example of the mixin by wrapping a class implementation.
|
|
298
|
+
*
|
|
299
|
+
* Note: while this pattern is supported, it is not recommended since it will
|
|
300
|
+
* not allow observable functionality to be used by the class in itself.
|
|
301
|
+
*
|
|
302
|
+
* ```ts
|
|
303
|
+
* const MyClass = observable(
|
|
304
|
+
* class MyClass {
|
|
305
|
+
* foo: string = "foo";
|
|
306
|
+
* }
|
|
307
|
+
* );
|
|
308
|
+
*
|
|
309
|
+
* const myClass = new MyClass();
|
|
310
|
+
* watch(myClass, "foo", (newValue, oldValue) => {});
|
|
311
|
+
* ```
|
|
312
|
+
*
|
|
313
|
+
* @param obj The class to make observable.
|
|
314
|
+
*/
|
|
315
|
+
export declare function observable<T extends abstract new (...args: any[]) => any = new () => ObservableMixin>(obj?: T): T & (abstract new (...args: any[]) => ObservableMixin);
|
|
316
|
+
/**
|
|
317
|
+
* Watches a property for changes. This can be a property on the given object or
|
|
318
|
+
* a property on a nested object if the nested object is also observable.
|
|
319
|
+
*
|
|
320
|
+
* This function will return a handle that can be used to stop watching the
|
|
321
|
+
* property.
|
|
322
|
+
*
|
|
323
|
+
* The callback will be invoked with the new value, old value, and the target
|
|
324
|
+
* object when the property changes. The target object is the object that
|
|
325
|
+
* contains the property that changed.
|
|
326
|
+
*
|
|
327
|
+
* The callback will not be invoked if the value has not changed. This includes
|
|
328
|
+
* if a parent property changes but the resulting value is the same as the
|
|
329
|
+
* previous value.
|
|
330
|
+
*
|
|
331
|
+
* If any property in the path can be undefined, the callback will be invoked
|
|
332
|
+
* with an undefined newValue and an undefined target when a parent property
|
|
333
|
+
* changes to undefined.
|
|
334
|
+
*
|
|
335
|
+
* ```ts
|
|
336
|
+
* class MyObservable extends observable() {
|
|
337
|
+
* private _backingFieldForGetter = "backingFieldForGetter";
|
|
338
|
+
* dataProperty: string = "dataProperty";
|
|
339
|
+
*
|
|
340
|
+
* get getter() {
|
|
341
|
+
* return this._backingFieldForGetter;
|
|
342
|
+
* }
|
|
343
|
+
* }
|
|
344
|
+
*
|
|
345
|
+
* const myObservable = new MyObservable();
|
|
346
|
+
* watch(myObservable, "getter", (newValue, oldValue) => {});
|
|
347
|
+
* watch(myObservable, "dataProperty", (newValue, oldValue) => {});
|
|
348
|
+
*
|
|
349
|
+
* class MyClass extends observable() {
|
|
350
|
+
* private _backingFieldForAccessor = new MyObservable();
|
|
351
|
+
*
|
|
352
|
+
* get getterSetter {
|
|
353
|
+
* return this._backingFieldForAccessor;
|
|
354
|
+
* }
|
|
355
|
+
* set getterSetter(value: MyObservable) {
|
|
356
|
+
* this._backingFieldForAccessor = value;
|
|
357
|
+
* }
|
|
358
|
+
* }
|
|
359
|
+
*
|
|
360
|
+
* const myClass = new MyClass();
|
|
361
|
+
* watch(myClass, "getterSetter", (newValue, oldValue) => {});
|
|
362
|
+
* watch(myClass, "getterSetter.getter", (newValue, oldValue) => {});
|
|
363
|
+
* watch(myClass, "getterSetter.dataProperty", (newValue, oldValue) => {});
|
|
364
|
+
* ```
|
|
365
|
+
*
|
|
366
|
+
* @param obj The object to watch.
|
|
367
|
+
* @param path The property path on the given object to watch.
|
|
368
|
+
* @param callback The callback to invoke when the property changes.
|
|
369
|
+
* @param options The options to use for watching the property.
|
|
370
|
+
* @throws Error if the object is not observable.
|
|
371
|
+
* @throws Error if the path is to a non-configurable property.
|
|
372
|
+
* @throws Error if the path is not a valid property path.
|
|
373
|
+
*/
|
|
374
|
+
export declare function watch<TObsv extends Observable, TPath extends ObservablePropertyPath<TObsv>, TValue extends ValueTypeFromPath<TObsv, TPath>, TTarget extends TargetTypeFromPath<TObsv, TPath>>(obj: TObsv, path: TPath, callback: (newValue: TValue, oldValue: TValue, target: TTarget) => void, options?: WatchOptions): IHandle;
|
|
375
|
+
export declare function watch<TObsv extends Observable, TPath extends `${string}.${string}.${string}.${string}`, TValue extends ValueTypeFromPath<TObsv, TPath>, TTarget extends TargetTypeFromPath<TObsv, TPath>>(obj: TObsv, path: TPath, callback: (newValue: TValue, oldValue: TValue, target: TTarget) => void, options?: WatchOptions): IHandle;
|
|
376
|
+
/**
|
|
377
|
+
* Watches a property for changes on each item in a collection like object. This
|
|
378
|
+
* can be a property on an item in a collection, an item in a collection in the
|
|
379
|
+
* given object or an item in a collection in a nested observable object.
|
|
380
|
+
*
|
|
381
|
+
* This function will return a handle that can be used to stop watching the
|
|
382
|
+
* property.
|
|
383
|
+
*
|
|
384
|
+
* If the collection contains multiple different types of objects, only objects
|
|
385
|
+
* that have the property being watched will be watched for changes, the other
|
|
386
|
+
* objects will be ignored.
|
|
387
|
+
*
|
|
388
|
+
* The callback will be invoked with the new value, old value, and the target
|
|
389
|
+
* object when the property changes. The target object will be the object in the
|
|
390
|
+
* collection that changed. The callback will be invoked for each item in the
|
|
391
|
+
* collection when the property on the object changes. The callback will not be
|
|
392
|
+
* invoked when items are added or removed from the collection unless the
|
|
393
|
+
* options include `initial: true` in which case the callback will be invoked
|
|
394
|
+
* for each item in the collection when the watch is created as well as for any
|
|
395
|
+
* items that are added to the collection after.
|
|
396
|
+
*
|
|
397
|
+
* The callback will not be invoked if the value has not changed. This includes
|
|
398
|
+
* if a parent property changes but the resulting value is the same as the
|
|
399
|
+
* previous value.
|
|
400
|
+
*
|
|
401
|
+
* If any property in the path after the path to the collection can be
|
|
402
|
+
* undefined, the callback will be invoked with an undefined newValue and an
|
|
403
|
+
* undefined target when a parent property changes to undefined.
|
|
404
|
+
*
|
|
405
|
+
* ```ts
|
|
406
|
+
* class MyObservable extends observable() {
|
|
407
|
+
* property: string = "testProperty";
|
|
408
|
+
* }
|
|
409
|
+
*
|
|
410
|
+
* class MyClass extends observable() {
|
|
411
|
+
* collection: Collection<MyObservable> = new Collection();
|
|
412
|
+
* }
|
|
413
|
+
*
|
|
414
|
+
* const myClass = new MyClass();
|
|
415
|
+
* watchEach(myClass, "collection.[].property", (newValue, oldValue) => {});
|
|
416
|
+
*
|
|
417
|
+
* const myCollection = new Collection<MyObservable>();
|
|
418
|
+
* watchEach(myCollection, "[].property", (newValue, oldValue) => {});
|
|
419
|
+
* ```
|
|
420
|
+
*
|
|
421
|
+
* @param obj The object to watch.
|
|
422
|
+
* @param path The property path on the given object to watch.
|
|
423
|
+
* @param callback The callback to invoke when the property changes.
|
|
424
|
+
* @param options The options to use for watching the property.
|
|
425
|
+
* @throws Error if the object is not observable.
|
|
426
|
+
* @throws Error if the path is to a non-configurable property.
|
|
427
|
+
* @throws Error if the path is not a valid property path.
|
|
428
|
+
*/
|
|
429
|
+
export declare function watchEach<TObsv extends Observable, TPath extends CollectionPropertyPath<TObsv>, TValue extends ValueTypeFromPath<TObsv, TPath>, TTarget extends TargetTypeFromPath<TObsv, TPath>>(obj: TObsv, path: TPath, callback: (newValue: TValue, oldValue: TValue, target: TTarget) => void, options?: WatchEachOptions): IHandle;
|
|
430
|
+
export declare function watchEach<TObsv extends Observable, TPath extends `${string}.[].${string}.${string}` | `[].${string}.${string}`, TValue extends ValueTypeFromPath<TObsv, TPath>, TTarget extends TargetTypeFromPath<TObsv, TPath>>(obj: TObsv, path: TPath, callback: (newValue: TValue, oldValue: TValue, target: TTarget) => void, options?: WatchEachOptions): IHandle;
|
|
431
|
+
/**
|
|
432
|
+
* Watches the given path on the given object for the first change.
|
|
433
|
+
*
|
|
434
|
+
* See {@link support/observableUtils!watch} for more details.
|
|
435
|
+
*
|
|
436
|
+
* @param obj The object to watch.
|
|
437
|
+
* @param path The property path to watch.
|
|
438
|
+
* @param options Optional. The options to use for watching the property.
|
|
439
|
+
* @param options.signal Optional signal to abort. The promise will be rejected
|
|
440
|
+
* if the signal is aborted.
|
|
441
|
+
* @throws Error if the object is not observable.
|
|
442
|
+
* @throws Error if the path is to a non-configurable property.
|
|
443
|
+
* @throws Error if the path is not a valid property path.
|
|
444
|
+
*/
|
|
445
|
+
export declare function once<TObsv extends Observable, TPath extends ObservablePropertyPath<TObsv>>(obj: TObsv, path: TPath, options?: {
|
|
446
|
+
signal?: AbortSignal;
|
|
447
|
+
}): Promise<void>;
|
|
448
|
+
/**
|
|
449
|
+
* Notifies any watchers that a property has changed. Will not notify if the
|
|
450
|
+
* value has not changed.
|
|
451
|
+
*
|
|
452
|
+
* Typically only used when a backing field for a getter only property has
|
|
453
|
+
* changed.
|
|
454
|
+
*
|
|
455
|
+
* @param obj The object with the property that changed.
|
|
456
|
+
* @param path The property that changed.
|
|
457
|
+
* @throws Error if the object is not observable.
|
|
458
|
+
*/
|
|
459
|
+
export declare function notifyChange<TObsv extends ObservableMixin, TPath extends keyof TObsv>(obj: TObsv, path: TPath): void;
|
|
460
|
+
/**
|
|
461
|
+
* For the given object, if a watch is added to the given path the callback will
|
|
462
|
+
* be invoked. When all the watches are removed, the handle returned by the
|
|
463
|
+
* callback will be invoked.
|
|
464
|
+
*
|
|
465
|
+
* A common use case for this is to notify changes to a property only if someone
|
|
466
|
+
* is watching it, this avoids unnecessary work from the watch if no one is
|
|
467
|
+
* watching the property.
|
|
468
|
+
*
|
|
469
|
+
* ```ts
|
|
470
|
+
* class MyClass extends observable() {
|
|
471
|
+
* _foo = "foo";
|
|
472
|
+
* _bar = "bar";
|
|
473
|
+
*
|
|
474
|
+
* get foo() {
|
|
475
|
+
* return `${this._foo} ${this._bar}`;
|
|
476
|
+
* }
|
|
477
|
+
*
|
|
478
|
+
* get bar() {
|
|
479
|
+
* return this._bar;
|
|
480
|
+
* }
|
|
481
|
+
* set bar(value: string) {
|
|
482
|
+
* this._bar = value;
|
|
483
|
+
* }
|
|
484
|
+
* }
|
|
485
|
+
*
|
|
486
|
+
* const myClass = new MyClass();
|
|
487
|
+
*
|
|
488
|
+
* onWatch(myClass, "foo", () =>
|
|
489
|
+
* watch(myClass, "bar", () => notifyChange(myClass, "foo"), {
|
|
490
|
+
* sync: true,
|
|
491
|
+
* })
|
|
492
|
+
* );
|
|
493
|
+
* ```
|
|
494
|
+
*
|
|
495
|
+
* @param obj The object to watch.
|
|
496
|
+
* @param path The property to watch.
|
|
497
|
+
* @param callback The callback to invoke when the property is watched.
|
|
498
|
+
* @throws Error if the object is not observable.
|
|
499
|
+
*/
|
|
500
|
+
export declare function onWatch<TObsv extends ObservableMixin>(obj: TObsv, path: keyof TObsv, callback: () => IHandle): IHandle;
|
|
501
|
+
/**
|
|
502
|
+
* Watches the given path on the given object for changes and automatically adds
|
|
503
|
+
* and removes the given event listener.
|
|
504
|
+
*
|
|
505
|
+
* @param obj The object to watch.
|
|
506
|
+
* @param path The property path to an Evented object on the given object to
|
|
507
|
+
* watch.
|
|
508
|
+
* @param event The event and the listener to add to the Evented object.
|
|
509
|
+
* @param watchCallback The callback to invoke when the watched property
|
|
510
|
+
* changes. This is optional and will be invoked with the Evented object being
|
|
511
|
+
* watched.
|
|
512
|
+
* @throws Error if the object is not observable.
|
|
513
|
+
* @throws Error if the path is to a non-configurable property on an observable.
|
|
514
|
+
*/
|
|
515
|
+
export declare function watchEvent<TObsv extends Observable, TPath extends EventedPropertyPath<TObsv>, TTarget extends EventedTypeFromPath<TObsv, TPath>>(obj: TObsv, path: TPath, event: OverloadParameters<NonNullable<TTarget>["on"]>, watchCallback?: (newTarget: TTarget, oldTarget: TTarget) => void): IHandle;
|
|
516
|
+
/**
|
|
517
|
+
* Watches the given path on the given object and invokes the callback when the
|
|
518
|
+
* value of the property becomes truthy.
|
|
519
|
+
*
|
|
520
|
+
* If the value of the property is already truthy, the callback will be invoked
|
|
521
|
+
* immediately.
|
|
522
|
+
*
|
|
523
|
+
* @param obj The object to watch.
|
|
524
|
+
* @param path The property path to watch.
|
|
525
|
+
* @param callback The callback to invoke when the property becomes truthy.
|
|
526
|
+
* @param options Optional. The options to use for watching the property.
|
|
527
|
+
*/
|
|
528
|
+
export declare function when<TObsv extends Observable, TPath extends ObservablePropertyPath<TObsv>>(obj: TObsv, path: TPath, callback: () => void, options?: WhenOptions): IHandle;
|
|
529
|
+
export declare function when<TObsv extends Observable, TPath extends `${string}.${string}.${string}.${string}`>(obj: TObsv, path: TPath, callback: () => void, options?: WhenOptions): IHandle;
|
|
530
|
+
/**
|
|
531
|
+
* Watches the given path on the given object for the first change that causes
|
|
532
|
+
* the value of the watched property to be truthy.
|
|
533
|
+
*
|
|
534
|
+
* See {@link support/observableUtils!watch} for more details.
|
|
535
|
+
*
|
|
536
|
+
* @param obj The object to watch.
|
|
537
|
+
* @param path The property path to watch.
|
|
538
|
+
* @param options Optional. The options to use for watching the property.
|
|
539
|
+
* @throws Error if the object is not observable.
|
|
540
|
+
* @throws Error if the path is to a non-configurable property on an observable.
|
|
541
|
+
*/
|
|
542
|
+
export declare function whenOnce<TObsv extends Observable, TPath extends ObservablePropertyPath<TObsv>>(obj: TObsv, path: TPath, options?: Pick<WhenOptions, "invert"> & {
|
|
543
|
+
/**
|
|
544
|
+
* The promise will be rejected if the signal is aborted.
|
|
545
|
+
*/
|
|
546
|
+
signal?: AbortSignal;
|
|
547
|
+
}): Promise<void>;
|
|
548
|
+
/**
|
|
549
|
+
* Creates an IHandle that will remove all the handles in the given iterable
|
|
550
|
+
* when the returned handle is removed.
|
|
551
|
+
*
|
|
552
|
+
* This holds the reference to the iterable of handles so that the handles can
|
|
553
|
+
* be updated and the returned handle will remove the handles in the iterable
|
|
554
|
+
* even if added later when it is removed.
|
|
555
|
+
*
|
|
556
|
+
* @param handles An iterable of handles to remove when the returned handle is
|
|
557
|
+
* removed.
|
|
558
|
+
*/
|
|
559
|
+
export declare function createIHandle(handles: Iterable<IHandle>): IHandle;
|
|
560
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"@arcgis/core/core/Accessor";import e from"@arcgis/core/core/Collection.js";import{Property as r}from"@arcgis/core/core/accessorSupport/Property";import{trackAccess as n}from"@arcgis/core/core/accessorSupport/tracking";import{watch as o}from"@arcgis/core/core/reactiveUtils";import{}from"../utilities/ObservableMap.js";function s(t){return null!=t&&"object"==typeof t&&"__isObservable"in t&&t.__isObservable}function i(t){if(s(t))return t}function c(e){return e instanceof t}function a(t){return t instanceof e||null!=t&&"esri.core.Collection"===t.declaredClass}function l(t){return s(t)&&"ObservableMap"===t[Symbol.toStringTag]}function u(t){return a(t)||l(t)||function(t){return s(t)&&"ObservableSet"===t[Symbol.toStringTag]}(t)}class h{}export function observable(t){return class extends(t??h){__isObservable=!0;_subscribedPaths=new Map;_onWatchPaths=new Map;_esriProps=new Map;constructor(...t){return super(...t),function(t){return new Proxy(t,{get:(t,e,r)=>{if("_esriProps"===e)return Reflect.get(t,e,r);const o=Reflect.get(t,e,r);let s=t._esriProps.get(e);return null==s&&(s=new w(e.toString(),o),t._esriProps.set(e,s)),n(s),o},set:(t,e,r,n)=>{if(Reflect.set(t,e,r,n),"_esriProps"===e)return!0;const o=t._esriProps.get(e);if(o){if(!o.invalidated&&r===o.currentValue)return!0;o.invalidate(),o.currentValue=r,o.commit()}return!0}})}(this)}_onWatch(t,e){let r,n;"string"==typeof t?(r=t,n=e):n=t;let o=this._onWatchPaths.get(r);if(null==o&&(o=[],this._onWatchPaths.set(r,o)),o.push(n),null!=r&&this._subscribedPaths.has(r)){this._subscribedPaths.get(r).onWatchHandles.set(n,n())}else if(null==r&&this._subscribedPaths.size>0)for(const[t,e]of this._subscribedPaths){const r=n(t);e.onWatchHandles.set(n,r)}const s=new WeakRef(this);return{remove:()=>{const t=s.deref();if(null==t)return;if(!t._onWatchPaths.has(r))return;const e=t._onWatchPaths.get(r),o=e.indexOf(n);if(-1!==o&&e.splice(o,1),null!=r&&t._subscribedPaths.has(r)){const e=t._subscribedPaths.get(r),o=e.onWatchHandles.get(n);null!=o&&(o.remove(),e.onWatchHandles.delete(n))}else if(null==r&&t._subscribedPaths.size>0)for(const[,e]of t._subscribedPaths){const t=e.onWatchHandles.get(n);null!=t&&(t.remove(),e.onWatchHandles.delete(n))}0===e.length&&t._onWatchPaths.delete(r)}}}_notifyChange(t){let e;e=null==t?this._subscribedPaths.keys():[t];for(const t of e){if(this._esriProps.has(t)){const e=this._esriProps.get(t),r=this[t];r!==e.currentValue&&(e.invalidate(),e.currentValue=r,e.commit())}const e=this._subscribedPaths.get(t);if(null==e)continue;const r=e.currentValue,n=this[t];if(Object.is(n,r))continue;e.currentValue=n;const o=[...e.callbacks];for(const t of o)t(n,r,this)}}_watch(t,e,r){const n=[];if(t.includes(".")){if(t.includes("[]"))return this._recurseCollectionWatch(t,e,r);const o=t.split("."),s=o.shift(),i=new AbortController,{signal:c}=i,a=new WeakRef(this);let l;const u=v(e,t),h=()=>{if(c.aborted)return void(l=void 0);const t=a.deref();if(null==t){for(const t of n)t.remove();return n.length=0,void(l=void 0)}let e=t[s],r=t;for(let t=0;t<o.length;t++)if(r=e,e=e?.[o[t]],null==e){t<o.length-1&&(r=void 0);break}if(e!==l){const t=l;l=e,u(e,t,r)}},f=r?.sync?v(h,t):_(h,t,c);let b,p,w;if([l,w,b,p]=this._recurseWatch(t,f),n.push(g(b,p)),r?.initial){(r?.sync?v(e,t):_(e,t,c))(l,l,w)}return d(n,i)}return this._watchSingle(t,e,r)}_recurseWatch(t,e){const r=t.split("."),n=r.shift(),o=[];let a,l;if(r.length>0){const t=this[n];if(s(t)){const[n,s,c,u]=i(t)._recurseWatch(r.join("."),e);o.push(g(c,u)),a=n,l=s}else if(c(t)){const[n,s,i]=f(t,r,e,{sync:!0});o.push(i),a=n,l=s}}const u=this._watchSingle(n,((t,n)=>{if(t!==n){if(r.length>0){if(s(n)||c(n)){for(const t of o)t.remove();o.length=0}if(s(t)){const[,,n,s]=i(t)._recurseWatch(r.join("."),e);o.push(g(n,s))}else if(c(t)){const[,,n]=f(t,r,e,{sync:!0});o.push(n)}}e()}}),{sync:!0});return[r.length>0?a:this._subscribedPaths.get(n).currentValue,r.length>0?l:this,o,u]}_recurseCollectionWatch(t,e,r){const n=t.split("."),o=n.shift();if("[]"===n[0])return this._collectionWatch(o,n,e,r);{const t=[],a=this._watchSingle(o,(o=>{for(const e of t)e.remove();t.length=0,s(o)?t.push(i(o)._recurseCollectionWatch(n.join("."),e,r)):c(o)&&t.push(f(o,n,e,r)[2])})),l=this[o];return s(l)?t.push(i(l)._recurseCollectionWatch(n.join("."),e,r)):c(l)&&t.push(f(l,n,e,r)[2]),g(t,a)}}_collectionWatch(t,e,r,n){const o=[];u(this[t])&&o.push(b(this[t],e.join("."),r,n));const s=this._watchSingle(t,((t,s)=>{if(u(s)){for(const t of o)t.remove();o.length=0}u(t)&&o.push(b(t,e.join("."),r,n))}),{sync:!0});return g(o,s)}_watchSingle(t,e,r){let n=this._subscribedPaths.get(t)?.callbacks;if(null==n){let e=Object.getOwnPropertyDescriptor(this,t),r=this;for(;null==e&&(r=Object.getPrototypeOf(r),null!=r);)e=Object.getOwnPropertyDescriptor(r,t);if(null==e)return console.warn(`[observableUtils]: The property ${t.toString()} you are trying to watch does not exist on the object and will not be watched. This is likely a coding error. Please check the property name and ensure it exists on the object. In the future this will throw an exception.`),{remove:()=>{}};if(!1===e.configurable)return console.warn(`[observableUtils]: Property "${t.toString()}" is not configurable so it cannot be watched. In the future this will throw an exception.`),{remove:()=>{}};n=[];const o=new Map;if(this._subscribedPaths.set(t,{callbacks:n,currentValue:this[t],onWatchHandles:o}),!0!==e.writable&&null==e.set||(this._subscribedPaths.get(t).originalDescriptor=e,null!=e.value&&(e.value=void 0),this._createWatchDescriptor(t,e)),this._onWatchPaths.has(t))for(const e of this._onWatchPaths.get(t))o.set(e,e());if(this._onWatchPaths.has(void 0))for(const e of this._onWatchPaths.get(void 0))o.set(e,e(t))}const o=new AbortController,s=v(e,t.toString()),{currentValue:i}=this._subscribedPaths.get(t);let c=i;const a=(t,e,r)=>{const n=c;c=t,s(t,n,r)},l=r?.sync?v(a,t.toString()):_(a,t.toString(),o.signal);return n.push(l),r?.initial&&l(i,i,this),this._createSingleWatchRemoveHandle(t,l,o)}_createWatchDescriptor(t,e){const r={configurable:!0,enumerable:e.enumerable};null==e.get?(r.get=()=>this._subscribedPaths.get(t).currentValue,r.set=e=>{const r=this._subscribedPaths.get(t),n=r.currentValue;if(Object.is(n,e))return;r.currentValue=e;const o=[...r.callbacks];for(const t of o)t(e,n,this)}):(r.get=e.get,r.set=r=>{const n=this._subscribedPaths.get(t),o=n.currentValue;if(Object.is(o,r))return void e.set.call(this,r);n.currentValue=r,e.set.call(this,r);const s=[...n.callbacks];for(const t of s)t(r,o,this)}),Object.defineProperty(this,t,r)}_createSingleWatchRemoveHandle(t,e,r){const n=new WeakRef(this);return{remove:()=>{r.abort();const o=n.deref();if(null==o)return;if(!o._subscribedPaths.has(t))return;const{callbacks:s}=o._subscribedPaths.get(t),i=s.indexOf(e);if(i>=0&&s.splice(i,1),0===s.length){const e=o._subscribedPaths.get(t);o._subscribedPaths.delete(t);for(const t of e.onWatchHandles.values())t.remove();null!=e.originalDescriptor&&(null==e.originalDescriptor.get&&(e.originalDescriptor.value=e.currentValue),Object.defineProperty(o,t,e.originalDescriptor))}}}}}}export function watch(t,e,r,n){if(!s(t)&&c(t))return f(t,e.split("."),r,n)[2];const o=i(t);if(null==o)throw new Error("Object is not observable");if(n?.once){let t;const s=new AbortController,{signal:i}=s,c=n?.sync?v(r,e):_(r,e,i);let a=!1;const l=(e,r,n)=>{i.aborted||(a=!0,t?.remove(),t=void 0,c(e,r,n))};t=o._watch(e,l,{...n,sync:!0});const u=d([t],s);return a&&u.remove(),u}return o._watch(e,r,n)}export function watchEach(t,e,r,n){if(u(t)&&e.startsWith("[]."))return b(t,e,r,n);if(!s(t)&&c(t))return f(t,e.split("."),r,n)[2];const o=i(t);if(null==o)throw new Error("Object is not observable");return o._watch(e,r,n)}export async function once(t,e,r){const{signal:n}=r??{};return new Promise(((r,o)=>{if(n?.aborted)return void o();const s=()=>{i.remove(),o()},i=watch(t,e,(()=>{n?.removeEventListener("abort",s),r()}),{once:!0});n?.addEventListener("abort",s)}))}export function notifyChange(t,e){const r=i(t);if(null==r)throw new Error("Object is not observable");if(null!=e&&"string"!=typeof e)throw new Error("Path must be a string");r._notifyChange(e)}export function onWatch(t,e,r){const n=i(t);if(null==n)throw new Error("Object is not observable");if("string"==typeof e)return n._onWatch(e,r);if("function"!=typeof e)throw new Error("Path must be a string or a function");return n._onWatch(e)}export function watchEvent(t,e,r,n){const o=r[0],s=r[1],i=new WeakMap,c=new Set;let a;return a=watch(t,e,((t,e)=>{if(null!=e&&i.has(e)){const t=i.get(e);t.remove(),i.delete(e),c.delete(t)}if(null!=t&&!i.has(t)){const e=t.on(o,s);i.set(t,e),c.add(e)}t!==e&&n?.(t,e)}),{sync:!0,initial:!0}),g(c,a)}export function when(t,e,r,n){const{invert:o=!1,once:s,...i}=n??{};let c;const a=v(r,e);let l=!1;return c=watch(t,e,(t=>{!t===o&&(a(),s&&(l=!0,c?.remove(),c=void 0))}),{...i,initial:!0}),s&&l&&c?.remove(),c}export function whenOnce(t,e,r){const{signal:n,invert:o=!1}=r??{};return new Promise(((r,s)=>{if(n?.aborted)return void s();const i=()=>{n?.removeEventListener("abort",i),c.remove(),s()},c=when(t,e,(()=>{n?.aborted||(n?.removeEventListener("abort",i),r())}),{invert:o,once:!0});n?.addEventListener("abort",i)}))}export function createIHandle(t){return{remove:()=>{for(const e of t)e.remove()}}}function f(t,e,r,n){const s=e.indexOf("[]");if(-1!==s){const o=e.slice(0,s),i=e.slice(s),c=[],[a,l,h]=f(t,o,((t,e)=>{if(u(e)){for(const t of c)t.remove();c.length=0}u(t)&&c.push(b(t,i.join("."),r,n))}),{sync:!0});return u(a)&&c.push(b(a,i.join("."),r,n)),[a,l,g(c,h)]}return function(t,e,r,n){const s=new WeakRef(t);let i;const c=()=>{let t=s.deref();if(null==t)return i?.remove(),[void 0,void 0];let r=t;for(let n=0;n<e.length;n++)if(t=r,r=t[e[n]],null==r){n<e.length-1&&(t=void 0);break}return[r,t]},a=new AbortController,{signal:l}=a,u=n?.initial&&!1===n?.sync?_(r,e.join("."),l):v(r,e.join(".")),h=function(t){const e=(e,r)=>{Object.is(e[0],r?.[0])||t(e[0],r?.[0],e[1])};return e}(u),[f,b]=c();return n?.initial&&n?.once?(u(f,f,b),[f,b,d([],a)]):(i=o(c,h,{...n,initial:!1}),n?.initial&&u(f,f,b),[f,b,d([i],a)])}(t,e,r,n)}function b(t,e,r,n){const o=new WeakMap,i=new Set,u=e.slice(3),h=t=>{if(!s(t)&&!c(t)||o.has(t))return;if(!(u.split(".")[0]in t))return;const e=watch(t,u,r,n);o.set(t,e),i.add(e)};i.add(t.on("after-add",(t=>{let e=t.item;"target"in t&&l(t.target)&&(e=t.item[1]),h(e)}))),i.add(t.on("after-remove",(t=>{let e=t.item;if("target"in t&&l(t.target)&&(e=t.item[1]),!s(e)&&!c(e))return;const r=o.get(e);null!=r&&(r.remove(),o.delete(e),i.delete(r))})));for(const e of a(t)?t:t.values())h(e);return g(i)}function d(t,e){return{remove:()=>{e?.abort();for(const e of t)e.remove()}}}function g(t,...e){return{remove:()=>{for(const e of t)e.remove();for(const t of e)t.remove()}}}const p="[observableUtils]: Error thrown by watch callback. Thrown errors from watch callbacks should be avoided where possible, they affect the performance of the entire watch system. Watch property:";function v(t,e){return(...r)=>{try{const n=t(...r);"object"==typeof n&&n instanceof Promise&&n.catch((t=>{console.error(`${p} ${e}`,t)}))}catch(t){console.error(`${p} ${e}`,t)}}}function _(t,e,r){const n=v(t,e);let o=new AbortController;return(...t)=>{o.abort(),o=new AbortController;const{signal:e}=o;queueMicrotask((()=>{r.aborted||e.aborted||n(...t)}))}}class w extends r{invalidated=!0;_currentValue;get currentValue(){return this._currentValue}set currentValue(t){this._currentValue=t,this.invalidated=!1}constructor(t,e){super(t,{}),this._currentValue=e}onInvalidated(){this.invalidated=!0,super.onInvalidated()}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e;import{__decorate as t}from"tslib";import s from"@arcgis/core/core/Collection";import i from"@arcgis/core/geometry/SpatialReference";import r from"@arcgis/core/layers/support/Field";import{addressToLocations as a,addressesToLocations as o,locationToAddress as
|
|
1
|
+
var e;import{__decorate as t}from"tslib";import s from"@arcgis/core/core/Collection";import i from"@arcgis/core/geometry/SpatialReference";import r from"@arcgis/core/layers/support/Field";import{addressToLocations as a,addressesToLocations as o,locationToAddress as c,suggestLocations as n}from"@arcgis/core/rest/locator";import{InvalidOperationError as l}from"../../InvalidOperationError.js";import{isFeature as d}from"../../ItemType.js";import{Feature as u,SCORE_FIELD as p,SCORE_FIELD_ORIGINAL as h}from"../../data/Feature.js";import{Schema as f}from"../../data/Schema.js";import{DefaultArcGISRequestHelper as g}from"../../support/ArcGISRequestHelper.js";import{cancelify as m}from"../../support/Cancellable.js";import{serializable as _}from"../../support/Serializable.js";import{notifyChange as y}from"../../support/observableUtils.js";import{ReadOnlyCollection as S}from"../../utilities/ReadOnlyCollection.js";import{checkArg as w}from"../../utilities/checkArg.js";import{load as b}from"../../utilities/esri.js";import{getLogger as A}from"../../utilities/log.js";import{toPortalItem as R}from"../../utilities/portal.js";import{ADDRESS_FIELD as v,GeocodeOptions as F,Geocoder as x}from"./Geocoder.js";export{v as ADDRESS_FIELD,p as SCORE_FIELD};const z=A("ArcGISGeocoder"),j="https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer",T="This schema property is read-only.",C="Match_addr";let B=e=class extends x{get requestHelper(){return this._requestHelper||(this._requestHelper=new g),this._requestHelper}set requestHelper(e){this._requestHelper=e}get categories(){return this._categories||(this._categories=new s),this._categories}get url(){return this._url}set url(e){this.updateUrl(e)}countryCode;_categories;_requestHelper;_singleLineAddressField;_maxBatchSize;_url;_magicKeyAddressMap=new Map;static async fromPortalItem(t,s){w("portalItem",t).isNotMissing();const i=R(t);await b(i);const r={...s};return void 0!==r.title&&null!==r.title||(r.title=i.title),r.url=i.url,new e(r)}updateUrl(e){return this._url===e?Promise.resolve():(this._url=e,this.isInitialized?(async()=>{const e=await this._getGeocodeService(this.url);this._updateGeocodeProperties(e)})():Promise.resolve())}async*geocode(e,t){w("address",e).isNotMissing(),await this.initialize();const s={...F.DEFAULTS,...F.fromFeatureSource(this),...t},i="string"==typeof e?this._magicKeyAddressMap?.get(e):void 0,{outFields:r,outSpatialReference:o,maxResults:c,searchArea:n}=s,l={address:this._addressToAttributes(e),categories:this.categories.toArray(),countryCode:this.countryCode,outFields:r,outSpatialReference:o,maxLocations:c,searchExtent:n?.extent,forStorage:void 0,magicKey:i,location:t?.searchPoint},d=a(this.url,l),u=await m(d,t?.cancelToken);yield*u.map((e=>this._candidateToFeature(e,s)))}async count(e,t){w("address",e).isNotMissing(),await this.initialize();const s={...F.DEFAULTS,...F.fromFeatureSource(this),...t},{outFields:i,outSpatialReference:r,maxResults:o,searchArea:c}=s,n={address:this._addressToAttributes(e),categories:this.categories.toArray(),countryCode:this.countryCode,outFields:i,outSpatialReference:r,maxLocations:o,searchExtent:c?c.extent:void 0,forStorage:void 0,magicKey:void 0,location:t?.searchPoint},l=a(this.url,n);return{source:this,count:(await m(l,t?.cancelToken)).length}}async*batchGeocode(e,t){w("addresses",e).isNotMissing(),await this.initialize();const s={...F.DEFAULTS,...F.fromFeatureSource(this),...t};if(!this.capabilities.supportsBatch)throw new l("Batch geocoding is not supported.");if(this._maxBatchSize&&e.length>this._maxBatchSize)throw new l(`Batch geocoding is limited to ${this._maxBatchSize} addresses at a time.`);let i=0;const r={addresses:e.map((e=>this._addressToAttributes(e,i++))),categories:this.categories.toArray(),countryCode:this.countryCode,outSpatialReference:s.outSpatialReference},a=o(this.url,r),c=(await m(a,t?.cancelToken)).map((e=>this._candidateToFeature(e,s)));for(const t of c){const s=t.attributes.get("ResultID");void 0!==s&&s>=0&&t.attributes.set(v,e[s]),t.attributes.delete("ResultID")}yield*c}async suggest(e,t){if(w("searchText",e).isNotMissing(),await this.initialize(),!this.capabilities.supportsSuggest)throw new l("Suggestions are not supported.");const s={text:e,categories:this.categories.toArray(),searchExtent:t?.searchArea?.extent,maxSuggestions:t?.maxResults,countryCode:this.countryCode,location:t?.searchPoint},i=n(this.url,s),r=await m(i,t?.cancelToken);return r.forEach((e=>this._magicKeyAddressMap.set(e.text,e.magicKey))),r.map((e=>e.text))}async reverseGeocode(e,t){w("location",e).isNotMissing(),await this.initialize();const s={...F.DEFAULTS,...F.fromFeatureSource(this),...t};if(!this.capabilities.supportsReverse)throw new l("Reverse geocoding is not supported.");let i;try{const r=c(this.url,{location:e,outSpatialReference:s.outSpatialReference});i=await m(r,t?.cancelToken)}catch(e){if(400===e.details?.httpStatus)return;throw e}const r=this._candidateToFeature(i,s);return r.settings.parent=this.featureSettings,r.schema.parent=this.addressSchema,r}_getSerializableProperties(){return{...super._getSerializableProperties(),url:"initial",categories:{serializeModes:["initial"],deserialize:e=>{this.categories.removeAll(),this.categories.addMany(e)}},countryCode:"initial",requestHelper:{serialize:!1}}}_createSchema(){return new G}_createAddressSchema(){return new G}async _onInitialize(){if(await super._onInitialize(),!this.url)throw new Error("ArcGISGeocoder must be created with a url.");let e;try{e=await this._getGeocodeService(this.url)}catch(t){t instanceof Error&&z.error({message:`Failed to get geocode service from ${this.url}. Using default service: ${j}.`,error:t}),await this.updateUrl(j),e=await this._getGeocodeService(this.url)}this._updateGeocodeProperties(e),this.assignProperties({});const t=i.fromJSON(e.spatialReference);this.schema.initialize({fields:e.candidateFields,spatialReference:t}),this.addressSchema.initialize({fields:e.addressFields,spatialReference:t})}async _getGeocodeService(e){const{data:t}=await this.requestHelper.request(e,{query:{f:"json"}});if(!t)throw new Error(`Response to request for url ${e} was invalid.`);return t}_updateGeocodeProperties(e){if(e.singleLineAddressField&&(this._singleLineAddressField=e.singleLineAddressField.name),e.locatorProperties&&(this._maxBatchSize=e.locatorProperties.MaxBatchSize),e.capabilities){const t=e.capabilities.split(",").map((e=>e.trim()));this._capabilitiesInternal=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsBatch:t.includes("Geocode"),supportsReverse:t.includes("ReverseGeocode"),supportsSuggest:t.includes("Suggest"),maxResults:void 0,supportsAttachmentEditing:!1})}else this._capabilitiesInternal=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsBatch:e.currentVersion>=10.1,supportsReverse:!0,supportsSuggest:!1,maxResults:void 0,supportsAttachmentEditing:!1})}_addressToAttributes(e,t){const s={};if("string"==typeof e)if(this._singleLineAddressField)s[this._singleLineAddressField]=e,[...this.defaultAddressValues.entries()].forEach((([e,t])=>{s[e]=t}));else{const t=this.addressSchema.fields.map((e=>e.name)).filter((e=>!this.defaultAddressValues.has(e))).toArray();if(1!==t.length)throw new l("Single line geocoding is not supported.");s[t[0]]=e}else{const t=d(e)?e.toGraphic().attributes:e;for(const e of this.addressSchema.fields.map((e=>e.name)).toArray())e in t?s[e]=t[e]:this.defaultAddressValues.has(e)&&(s[e]=this.defaultAddressValues.get(e));if(0===Object.keys(s).length)throw new l("At least one valid address field is required.")}return void 0!==t&&(s.OBJECTID=t),s}_candidateToFeature(e,t){const s=new u({source:this});if(e.attributes)for(const t of Object.keys(e.attributes))s.attributes.set(t,e.attributes[t]);const{address:i}=e;if("string"!=typeof i||s.attributes.has(C)&&s.attributes.get(C)){if("object"==typeof i&&i)for(const e of Object.keys(i))s.attributes.set(e,i[e])}else i?s.attributes.set(C,i):s.attributes.set(C,Object.values(e.attributes).join(", "));return e.score&&(s.attributes.set(p,e.score),s.attributes.set(h,e.score)),s.geometry=e.location,t.outSpatialReference&&(s.schema.spatialReference=t.outSpatialReference),s}};B=e=t([_],B);export{B as ArcGISGeocoder};let G=class extends f{_spatialReference;_fieldBackingCollection;_fieldCollection;constructor(){super(),this._fieldBackingCollection=new s,this._fieldCollection=new S(this._fieldBackingCollection),y(this,"_fields")}get _fields(){return this._fieldCollection}get spatialReference(){return this._spatialReference}set spatialReference(e){throw new l(T)}get geometryType(){return"point"}set geometryType(e){throw new l(T)}initialize(e){if(e.fields&&(this._fieldBackingCollection.removeAll(),this._fieldBackingCollection.addMany(e.fields.map((e=>r.fromJSON(e))))),e.spatialReference&&(this._spatialReference=e.spatialReference,y(this,"spatialReference")),!this.isModified("displayField")){let e=this.fields.findFieldByName("match_addr");e||(e=this.fields.findFieldByName("address")),e&&(this.displayField=e.name)}}};G=t([_],G);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toFeature as e}from"../../data/Feature.js";import{cancelify as t,cancelifyWithAbortSignal as r}from"../../support/Cancellable.js";import
|
|
1
|
+
import{toFeature as e}from"../../data/Feature.js";import{cancelify as t,cancelifyWithAbortSignal as r}from"../../support/Cancellable.js";import{watch as i}from"../../support/observableUtils.js";import*as a from"../../utilities/asyncIterable.js";import{isSubtypeSublayerExtension as s}from"../../utilities/extensions.js";import{isBuildingComponentSublayer as n}from"../../utilities/layers.js";import{QueryProviderBase as o}from"./QueryProviderBase.js";export class ClientSideQueryProvider extends o{get _waitForUpdatingFinished(){return!0}_query(t,r,i){const s=this;return async function*(){const n=await s._getClientSideLayerGraphics(t,r,i);n?.length?yield*n.map((r=>e(r,{source:t}))):yield*a.empty()}()}async _count(e,t,r){const i=await this._getClientSideLayerGraphics(e,t,r);return{source:e,count:i?i.length:0}}_createQuery(e,t,r){const i=s(e)?e.layerExtension:e,{_layerView:a,featureSettings:o}=i,l=n(i.sublayer)?e.layerExtension?.mapExtension:e.mapExtension,u=a.createQuery();return u.where=t,u.geometry=r.spatialFilter,u.outFields=o.outFields,u.returnGeometry=r.returnGeometry,u.outSpatialReference=r.outSpatialReference,u.maxAllowableOffset=r.maxAllowableOffset,u.num=r.maxResults,u.returnZ="scene"===l?.viewMode,u}async _getClientSideLayerGraphics(e,a,n){const o=s(e)?e.layerExtension:e,{_layerView:l}=o;if(!l)return;this._waitForUpdatingFinished&&await t(new Promise(((e,t)=>{l.updating||e();const r=i(l,"updating",(t=>{t||(r.remove(),e())}))})),n.cancelToken);const u=await r((async t=>l.queryFeatures(this._createQuery(e,a,n),{signal:t})),n.cancelToken);return u?.features}}
|