arcgis-rest-js icon indicating copy to clipboard operation
arcgis-rest-js copied to clipboard

Restore IDrawingInfo type

Open thw0rted opened this issue 1 year ago • 2 comments

The old arcgis-rest-types package exposed an interface that describes the shape of the drawingInfo field in a layer definition, even though the actual types under ILayerDefinition failed to use it. rest-feature-service should expose that interface again, and ideally use it as the type of the drawingInfo field.

thw0rted avatar Jul 18 '22 16:07 thw0rted

Just as a side note: it would be extra nice if somebody felt inclined to flesh out the missing parts of that old interface, like I had to make my own types to describe the renderer property, which has helpful uniqueValueInfos (which, themselves, needed a custom interface).

thw0rted avatar Jul 18 '22 16:07 thw0rted

@thw0rted ArcGIS REST JS is not and was never supposed to be a types library for ArcGIS. We generally implemented types when it was helpful for our own documentation for custom methods. When we had types included most of our issues ended up actually being about adding this type or that type when it was unrelated to the actual request/response process. See https://github.com/Esri/arcgis-rest-js/issues/668#issuecomment-608006590 for some of my thoughts on this.

It is also REALLY, REALLY hard to be an authoritative type library even if we wanted to. For example the old IDrawingInfo field is based on the type in the web map specification NOT the type returned by getService() or addToServiceDefinition() (the methods where ILayerDefinition is used). My best guess is that should be the renderer documented in common data types. But the type of the renderer property isn't actually documented anywhere in an authoritative way.

In the end it seemed better to be broad rather then to act like the authoritative type library for everything. If you still need things from arcgis-rest-types nothing prevents you from installing v3 of it and importing what you need.

If you want to do a PR restoring the old IDrawingInfo and have ILayerDefinition I would accept it because ILayerDefinition is used by some of our methods.

patrickarlt avatar Aug 15 '22 22:08 patrickarlt