rethinkdb / horizon

Horizon is a realtime, open-source backend for JavaScript apps.
MIT License
6.78k stars 349 forks source link

Add Typescript Definitions #821

Closed marshall007 closed 8 years ago

marshall007 commented 8 years ago

In order for Typescript projects to recognize imports from npm packages, a .d.ts typings definitions file must be present or referenced externally. Adding a typings definition allows Horizon to be seamlessly imported into Angular 2 applications.

npm install @horizon/client --save
import Horizon from '@horizon/client';

Without this, you are forced to either reference Horizon as a global via a <script> tag or specify additional scripts via angular-cli.json and use require.

I attempted to cover all of the public API in these definitions, but I'm sure it's not totally complete yet. I think this provides a good enough starting point to at least get things working in Angular 2.


This change is Reviewable

marshall007 commented 8 years ago

/ping @deontologician

deontologician commented 8 years ago
:lgtm:
somombo commented 7 years ago

@deontologician, is this part of the latest release yet?