Upgrading JavaScript

Converting a JavaScript Project to a TypeScript Project

Rename any ".js" files to ".ts".

Download the type definition files for jQuery
npm - @types/jquery

Download the type definition files for Office.js
npm - @types/office-js

Check the references in all the '.ts' files.
Open Home.ts

Create a new file at the root tsconfig.json

    "compilerOptions": {
        "skipLibCheck": true,
        "lib": [ "es5", "dom", "es2015.promise" ]

Project Properties - TypeScript Build Tab
check the ECMAScript version

The compiler will generate javascript files from the typescript files so your html files should continue to reference the '.js' files.
The compiler will also generate '.js.map' files

© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited TopPrevNext