I like to use [rx-node](http://npmjs.com/package/rx-node) within TypeScript

```
import RxNode from 'rx-node';

```

I installed [rx-node](http://npmjs.com/package/rx-node) using npm

```
$ npm install rx-node --save

```

I searched for type definitions, but without any result

```
$ typings search rx-node
No results found for search

```

How can I define custom type definitions for the installed npm module [rx-node](http://npmjs.com/package/rx-node)? Where should I store the type definition file? How to configure TypeScript (*tsconfig.json* and *typings.json*)?

**Edit:** Thanks to [Aleksey L.](https://stackoverflow.com/a/37642950/1065654) and [David Bohunek](https://stackoverflow.com/a/37642510/1065654) I achieved to define a `rx-node.d.ts` that looks like this

```
declare module "rx-node" {
  import {Observable} from '@reactivex/rxjs';
  import {ReadLine} from "readline";

  function fromReadLineStream(stream: ReadLine): Observable<string>
}

```

I installed [@reactivex/rxjs](https://github.com/ReactiveX/rxjs#all-module-types-cjses6amdtypescript-via-npm)

```
npm install --save @reactivex/rxjs

```

Since I got an error

```
node_modules\@reactivex\rxjs\dist\cjs\Observable.d.ts (10,66): Cannot find name 'Promise'. (2304)

```

I changed the target in *tsconfig.json* to `es6`.