I had not come across such a notation:
function(a: number,
sort?: { order: -1 | 1; sortBy: string }[] ){
//function body here
}
Specifially I'm interested in the sort parameter.
I can only understand that sort is an optional argument (I can't even say for sure if it's an object literal since there's no ,).
What does this syntax read? What type of variable is it? Why is there a ; instead of a ,(BTW that is not a typo). What does {...}[] indicate?
public station functionis not valid). This will allow those who want to help you to immediately get to work solving the problem without first needing to re-create it. And it will make it so that any answer you get is testable against a well-defined use case.