tsconfig.tpl.json

All options of the TypeScript compiler are set in tsconfig.json. This checks whether API calls are used correctly, for example.

Type definitions for jQuery, the framework and the controls are required to analyze the source code. These are provided with the NuGet packages. Since these paths are not always in the same place, the user only edits this template file. Visual Studio uses this to create the correct tsconfig.json.

compilerOptions

The default is a standard set of options in the compilerOptions section. These can be changed. However, it is possible that subsequently a project can no longer be built or no longer works in all browsers.

See the official documentation: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html

include

Type definitions for APIs that do not come from the browser itself are integrated in the include section. The entry

"$(Beckhoff.TwinCAT.HMI.Framework).InstallPath/TcHmi.d.ts"

that references jQuery, framework and the system controls is essential. If, for example, an TcHmiButton is to be created in a control factory, the NuGet package Beckhoff.TwinCAT.HMI.Controls must be integrated and this line must be added:

"$(Beckhoff.TwinCAT.HMI.Controls).InstallPath/TcHmiButton.d.ts"

files

Under Files, all TypeScript files to be compiled by the TypeScript compiler must be included individually and in the correct order. New files for functions or controls are automatically added here, but manual intervention may also be necessary.

The TypeScript compiler then creates JavaScript files with the same base name and the extension .js instead of .ts. This should be entered under Controls in description.json, for example.