Reverse Engineered Code from extension.js to Extension.ts