I have a function which receives a variable number of arguments (each of type string), and a final argument (of a complex type, called Expression).
In JavaScript, this looks like:
function layerProp(...args) {
const fields = args.slice(0, -1)
const fallbackExpression = args.slice(-1)[0]
How can I write a type definition for this function?
For the function argument you can write as
...args: string[], From the function implementationfallbackExpressionis a simple string. So it would be better to use a interface instead of a type