UNPKG

1.53 kBMarkdownView Raw
1TypeScript API
2==============
3
4> TypeScript API exposed (includes definition file).
5
6This version is compatable with TypeScript 1.0.
7
8[![Dependency Status][]](https://gemnasium.com/jedmao/typescript-api)
9[![NPM version][]](http://badge.fury.io/js/typescript-api)
10[![Views][]](https://sourcegraph.com/github.com/jedmao/typescript-api)
11
12[![NPM][]](https://nodei.co/npm/typescript-api/)
13
14
15## TypeScript Usage
16
17First, install dt-node as a bower dependency:
18
19```bash
20$ bower install --save-dev dt-node https://github.com/jedmao/dt-node.git
21```
22
23Then, you can reference the typescript-api.d.ts. You have to do it this way
24because the typescript-api has to use the same node.d.ts that your application is
25using. Otherwise, it will throw compiler errors.
26
27```ts
28/// <reference path="node_modules/typescript-api/typescript-api.d.ts" />
29import ts = require('typescript-api');
30var compiler = new ts.TypeScriptCompiler(new ts.NullLogger());
31```
32
33
34## JavaScript Usage
35
36```js
37var ts = require('typescript-api');
38var compiler = new ts.TypeScriptCompiler(new ts.NullLogger());
39```
40
41
42## License
43
44Released under the MIT license.
45
46[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/jedmao/typescript-api/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
47
48
49[Dependency Status]: https://gemnasium.com/jedmao/typescript-api.png
50[NPM version]: https://badge.fury.io/js/typescript-api.png
51[Views]: https://sourcegraph.com/api/repos/github.com/jedmao/typescript-api/counters/views-24h.png
52[NPM]: https://nodei.co/npm/typescript-api.png?downloads=true