News for hackers. Stuff that matters.
Re:TypeScript is terrible for library developers by bzxcvbn on Tuesday August 23, 2022 @04:14PM (#32570842)
Your problem would be solved pretty easily by making two changes to your API:

* Only accept an array of strings. Not a single string, not several strings, not several arrays of strings, and certainly not a space/comma-separated list of classes.

* Add another single overload where you accept a function that takes two parameters. That function can ignore its parameters if it wants to, and it returns a list of strings, so you don't need to accept several.

You have the same functionality, it's not harder to use for an end-user, and it's infinitely simpler to type.

There are no comments on this comment yet.