I have this array which is used to define how a portion of an application works (ie this defines a portion of config)
const injectableServices: Array<keyof SymbolDefinitionInjectMap> = ["webServices", "displayProvider", "assetContext"];
I then have the implementation layer which makes use of the configured object.
const [webServices, displayProvider, assetContext] = getServices(inject, args) as [
SymbolDefinitionInjectMap["webServices"],
SymbolDefinitionInjectMap["displayProvider"],
SymbolDefinitionInjectMap["assetContext"],
];
Now, this works. But, injectableServices can be anywhere from 0 to 50 items. And I'd rather not manually type them out by running getServices. Is there any way to automatically type the results? The items in injectableServices have defined types and will ALWAYS be returned in the same order from getServices.