diff --git a/types/enigma.js/enigma.js-tests.ts b/types/enigma.js/enigma.js-tests.ts index 6a88b2d2ff..10f6aae226 100644 --- a/types/enigma.js/enigma.js-tests.ts +++ b/types/enigma.js/enigma.js-tests.ts @@ -1,8 +1,10 @@ import * as enigma from "enigma.js"; +// import enigma = require("enigma.js"); -enigma.create({ - url: "http://127.0.0.1:4848/", - schema: {} -}).open().then((global) => { +const config: enigmaJS.IConfig = { + url: "http://127.0.0.1:4848/", + schema: {} + }; +enigma.create(config).open().then((global) => { console.log("connect fine"); }); diff --git a/types/enigma.js/index.d.ts b/types/enigma.js/index.d.ts index 29a5dcfb5b..38fc18da16 100644 --- a/types/enigma.js/index.d.ts +++ b/types/enigma.js/index.d.ts @@ -5,11 +5,15 @@ // TypeScript Version: 2.2 declare module "enigma.js" { - const e: IEnigmaJSClass; + const e: IEnigmaClass; export = e; } -interface IEnigmaJSClass { +// declare const enigmaJS: IEnigmaClass; +// export = enigmaJS; +// export as namespace enigmaJS; + +interface IEnigmaClass { /** * Create a session object. * @returns - Returns a session. @@ -94,12 +98,6 @@ declare namespace enigmaJS { } interface ISession { - /** - * Establishes the websocket against the configured URL. Eventually resolved with the QIX global interface when the connection has been established. - * @return Promise. - */ - open(): Promise; - /** * Establishes the websocket against the configured URL. Eventually resolved with the QIX global interface when the connection has been established. * @return Promise.