Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Developer Guide

Norman Fomferra edited this page Nov 17, 2016 · 1 revision

Primary development language is TypeScript.

Imports

If you import a library mylib in your TypeScript code

import * as mylib from 'mylib';

the TypeScript compiler tsc will search for mylib.ts, mylib.tsx, mylib.d.ts in various locations including your local node_modules folder. When tsc can't find any of the above, but it is a JavaScript module in your node_modules, then first try

$ npm install @types/mylib --save-dev

If it succeeds, make sure the versions of the installed @types/mylib and mylib are compatible. If a @types/mylib cannot be found you could create your own mylib.d.ts but this is usually very expensive task if mylib is non-trivial. The easiest way to continue is to try a plain CommonJS/RequireJS import of mylib:

const mylib: any = require('mylib');

and therefore to import the plain JavaScript library without any type definitions.

Clone this wiki locally