From 756433aeb47ea33ec79bb634cef662be941178e8 Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Sun, 22 Jan 2017 00:58:37 +0200 Subject: [PATCH] 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. --- elastic.js/elastic.js-tests.ts | 2 ++ elastic.js/index.d.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/elastic.js/elastic.js-tests.ts b/elastic.js/elastic.js-tests.ts index 927cb73d91..e7bd65ea16 100644 --- a/elastic.js/elastic.js-tests.ts +++ b/elastic.js/elastic.js-tests.ts @@ -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')) diff --git a/elastic.js/index.d.ts b/elastic.js/index.d.ts index 99a45f58fa..adb0db6950 100644 --- a/elastic.js/index.d.ts +++ b/elastic.js/index.d.ts @@ -3,6 +3,10 @@ // Definitions by: Oleksii Trekhleb // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export = elasticjs; + +export as namespace elasticjs; + declare module elasticjs { export interface Facet {}