Fix elastic.js typings. Adding module and namespace exports. (#14152)

* Fix elastic.js typings namespace from 'elasticjs' to 'elastic.js'.

 This will allow using 'import' statement against elastic.js like so:
 import * as elasticjs from 'elastic.js';

 This also makes using this typings to be TSlint "no-var-require" rule compliant.

* Export elasticjs namespace.
This commit is contained in:
Oleksii Trekhleb
2017-01-22 00:58:37 +02:00
committed by Mohamed Hegazy
parent 3357f1a623
commit 756433aeb4
2 changed files with 6 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
import * as elasticjs from 'elastic.js';
let body = new elasticjs.Request({})
.query(new elasticjs.MatchQuery('title_field', 'testQuery'))
.facet(new elasticjs.TermsFacet('tags').field('tags'))

View File

@@ -3,6 +3,10 @@
// Definitions by: Oleksii Trekhleb <https://ua.linkedin.com/in/trekhleb>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = elasticjs;
export as namespace elasticjs;
declare module elasticjs {
export interface Facet {}