Typescript function parameter Types
Defining a wrapper function with the same parameters as the inner function.
import { spawn } from 'child_process';
function customSpawn(...options: Parameters<typeof spawn>) {
console.log('some custom code');
return spawn(...options);
}