Version: next

Typecheck

TypeScript is used when typechecking code.

Typecheck code

To typecheck code run the following command:

ts-engine typecheck

Emit types for libraries

When building a library it is good practice to ship types with it too for consumers who use TypeScript.

To emit type declaration files run the following command:

ts-engine typecheck --emit

Type files will be outputted into dist/ for each file that is included in the build tree, so if main.ts imported print.ts then print.ts would also have a type definition file.

Entry filesOutput files
src/main.tsdist/main.d.ts
src/print.tsdist/print.d.ts

Watching for changes

The typecheck command also supports watching for changes to source code and rerunning typecheck automatically when changes occur.

To typecheck and trigger watch mode run the following command:

ts-engine typecheck --watch