Skip to content

9. TypeScript

CookieShade edited this page Aug 7, 2016 · 3 revisions

TypeScript usage of BETA.js

The library comes with a TypeScript declaration file, BETA.d.ts which has all the neccessary type information the compiler needs to be able to reference the library.

Types

The declaration file defines all the normal functions of the library, and a few extra types:

Usage

Include this comment in your TypeScript code:

/// <reference path="path/to/BETA.d.ts" />

Now the compiler knows about the library. Make sure to actually include BETA.js in the output file as well, or you'll just get drowned in runtime errors.

Clone this wiki locally