I am wrapping a built-in node function and I would like to refer to the original node type definition. Obviously JavaScript is an untyped language but I was wondering if there was a comment syntax I could use to forward type signature inspection to a TypeScript definition.
const { spawn, spawnSync } = require('child_process')
let shell = undefined
if (process.platform === 'win32' && process.platform === 'x64') {
shell = 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe' // x64
}
if (process.platform === 'win32' && process.platform === 'x32') {
shell = 'C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe' // x32
}
// can I send people straight to child_process.spawn?
exports.spawn = (command, args, options) => {
return spawn(command, args, { shell, ...options })
}