Hi,
I might want/need to add some functionality into the default LayerList Widget - the typescript (*.tsx file) is available here:
https://github.com/Esri/arcgis-js-api/blob/4master/widgets/LayerList.tsx
The thing is that the typings for LayerListViewModel, ListItem etc is not available (only *.js files)
TypeScript not my forte, so I throw questions out here:
Is this a cul-de-sac - should I rather develop from scratch? ..last resort..
Much appreciated!
You can get the typings from here: jsapi-resources/4.x/typescript at master · Esri/jsapi-resources · GitHub
I'm not sure the exact issue you're running into, or the best way to approach this in general. My feeling is that there is almost certainly a way to use the .js files with those typings but I'd have to play around with it to figure it out I'm sure.
Also, what capability do you need to add to the layer list? There may be an easier way to add it on top, at runtime, as opposed to modifying the source code.
Hi Thomas
The most pressing requirement was CSS styles based on indent level in the tree structure. (This I could get working with with CSS selectors now)
Then also to:
I played with the typing's you referenced but it seems it is somewhat different than what is needed by the LayerList.tsx. I will continue to investigate...
Just an update - I were able to to get this LayerList.tsx to compile as part of my project in Visual Studio. It was a bit painful with a couple of issues:
I also upgraded to a custom version of 4.4, but there is bugs like the grade out layers when out of scale stopped working.