The objective of the definition you are showing is to provide the developer with intellisense + typesafety. You would use it like you normally would want to in javascript:
window.onerror= function(eventOrMessage: any, source: string, fileno: number){
// place your body here
};
See it on typescript playground.
More:
If you try to assign it a wrong function you will get an error:
// Error: wrong type for fileno
window.onerror= function(eventOrMessage: any, source: string, fileno: string){
};
You could omit any of the arguments since functions with lesser arguments are type compatible e.g. the following is valid typescript:
window.onerror= function(callitWhaever_ButItWillTakeTheEventOrErrorMessage){
// place your body here
};