converted debugger.js to TypeScript