Check out example codes for "how to compile ts in cmd". It will help you in understanding the concepts better.

Code Example 1

"scripts": {
    "clean": "rimraf dist",
    "start": "npm-run-all clean --parallel watch:build watch:server --print-label",
    "watch:build": "tsc --watch",
    "watch:server": "nodemon './dist/index.js' --watch './dist'"
}

Learn ReactJs, React Native from akashmittal.com