TypeScript and Omni Automation

TypeScript is an open-source language which builds on JavaScript, one of the world’s most used tools, by adding static type definitions.

Fully documented on typescriptlang.org TypeScript includes the use of the TypeScript Server, an instance of the Language Server Protocol (LSP) that can provide active JavaScript error checking and code completion within supporting code editor applications.

The following documentation details how to install the TypeScript Server components for use with code editing applications used to compose and edit Omni Automation plug-ins and scripts.

Installing the Supporting Tools

The TypeScript Language Server uses Node.js as an environment for performing its functionality. Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine.

DO THIS ►

Download NodeJS Installer from the nodejs.org website.

(⬇ see below ) The Node.js installer package icon:

The installer package icon

NOTE: The Node.js installer will install both Node.js and npm (Node Package Manager) a tool for organizing the Node.js toolset. For our purposes, it is not necessary to know the details of how these open-source tools function. They are a requirement for the installation of the TypeScript Language Server.

DO THIS ►

Open the Node.js Installer and begin the installation process by clicking the “Continue” button in the first screen:

The opening screen of ther Node.js installer

Installing TypeScript and TypeScript Language Server

The TypeScript components and server can be installed from their online providers using the NPM tools that you just installed.

DO THIS ►

Open the Terminal Application. In LaunchPad type “Terminal” to reveal and select the Terminal application. Press the Return key to launch the application.

Entering “Terminal” in the LaunchPad

A new Terminal session window will open, displaying a blinking cursor indicating that it is ready to accept your input.

DO THIS ►

Copy the command for installing TypeScript shown below and paste it into the Terminal window.

The Install TypeScript Command


sudo npm install -g typescript
Screenshot
DO THIS ►

Run the command by pressing the Return or Enter key. You will be prompted to enter an administrative password for the current user.

Screenshot
DO THIS ►

Enter the password and press the Enter or Return key. The Terminal window will display a progress indicator as it installs the required items:

Screenshot

When the TypeScript installation has completed, a message similar to the following will be displayed:

Screenshot
DO THIS ►

Copy the command shown below for installing TypeScript Server and paste it into the Terminal window.

	The Install TypeScript Server Command
	
	
sudo npm install -g typescript-language-server
Screenshot
DO THIS ►

Run the command by pressing the Return or Enter key. Since you’ve already supplied the password in the previous installation, you won’t be prompted again. When the installation has completed, the Terminal window will display a message similar to this:

Screenshot

Omni Automation Development Environment

In order to edit Omni Automation plug-ins using TypeScript, specific files require installation.

DO THIS ►

DOWNLOAD a ZIP archive containing the items that are placed within your TypeScript project folder:

Here are links to download the TypeScript Definition files for each of the Omni applications:

3rd-Party Omni Automation Editors with TypeScript Support