I have a function like this
function foobar(...args): any {
....
}
The function signature is rather general, but it only accepts strings and an last an object of type X (all being optional)
foobar();
foobar('a');
foobar('a', 'b', 'c');
foobar('a', { ... });
foonbar('a', 'b', { ... });
Is there some way that types can be added, for example
function foobar(...args: [...string, X]) { // this doesn't work!
}
Any suggestions ?