

Once you have installed Visual Studio Code, Typescript and Webpack you can start with creating Stellarium scripts in Typescript. Npm install webpack webpack-cli ts-loader typescript -save-dev Npm install webpack webpack-cli -save-dev # Install webpack and ts-loader in the user home directory Sudo apt install npm # may already be installed Please note that some of the packages will be installed to the local users home directory! After executing the commands you will find a newly created folder named "node_modules". The following instructions will install the required packages. LabelMgr.labelScreen("Hello world", 400, 550, true, 100, "#66ccff") Ĭore.debug(" + Control Stellarium with Typescript!")Ĭore.debug(" + Keep your sanity whilst working with ECMA script")Ĭore.debug(" + get a onscreen display of bug messages")įor (var i=0 i 3.0) is needed for transpiling the typescript source code into ECMAScript and Webpack is required for bundling it into a single file. Description: A demonstrational script for tramnspiling typescript to stellarium Here is how a minimalistic example of Stellarium Typescript code looks like:

Syntax highlighting tailormade for Stellarium's native command set.You do not have to execute the script to catch errors. Typescripts static typing will allow you to catch many programming errors while coding.The benefits of using Typescript and Visual Studio Code: Typescript code is not executed directly but transpiled into ECMAScript. It was developed to make working with ECMAScript easier and safer. The Typescript language is a strict syntactical superset of ECMAScript. Stellarium is using QtScript which is an implementation of the ECMAScript specification. The script API of Stellarium is quite powerfull but there are certain limitations that make writing complex scripts difficult. In this article i will explain how to set up the Visual Studio Code development environment forĭeveloping Stellarium scripts in Typescript. One of the features of Stellarium is its scriptability.

Stellarium is an open source astronomy software capable of rendering the night sky with near photographic realism. Stellarium Scripting with Typescript - Stellarium Automation with Typescript and Visual Studio Code Stellarium Scripting with Typescript
