I need to create some number of Services, which are factory patterns returning a collection of methods in an object. Since I plan to reuse the Service type for several services, all with different methods, it is impossible to know their signatures in advance. Thus I want to have the methods typed as unknown[] => unknown, and then to extend that in a given service implementation with its actual signature(s). I cannot get this to work, I have tried several different combinations of generics, extending, whatnot. I did manage to make it work by swapping the unknown's for any's - but I dont believe this should be necessary here, and my linter hates it too. Any help would be appreciated
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.