* add test-enigma.js.ts

* fix small types

Signed-off-by: Konrad Mattheis <konrad.mattheis@akquinet.de>
This commit is contained in:
Konrad Mattheis
2017-11-15 15:25:28 +01:00
parent 0d5a1ef269
commit 70406cb8e7
4 changed files with 23 additions and 10 deletions
+9 -6
View File
@@ -4,12 +4,15 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
declare module "enigma.js" {
const e: IEnigmaJSClass;
export = e;
}
// declare module "enigma.js" {
// const e: IEnigmaJSClass;
// export = e;
// }
declare const enigmaJS: IEnigmaClass;
export = enigmaJS;
export as namespace enigmaJS;
interface IEnigmaJSClass {
interface IEnigmaClass {
/**
* Create a session object.
* @returns - Returns a session.
@@ -27,7 +30,7 @@ declare namespace enigmaJS {
* types such as barchart, story and myCustomType.
* An API will get both their generic type as well as custom type mixins applied.
*/
types: [MixinType];
types: MixinType[];
init(args: {config: any, api: IGeneratedAPI}): void;
+8
View File
@@ -0,0 +1,8 @@
import * as enigma from "enigma.js";
enigma.create({
url: "http://127.0.0.1:4848/",
schema: {}
}).open().then((global) => {
console.log("connect fine");
});
+2 -1
View File
@@ -18,6 +18,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts"
"index.d.ts",
"test-enigma.js.ts"
]
}
+4 -3
View File
@@ -2,9 +2,10 @@
"extends": "dtslint/dt.json",
"rules": {
// TODOs
"interface-name": false,
"ban-types": false,
"no-empty-interface": false,
"no-mergeable-namespace": false,
"no-unnecessary-generics": false,
"no-single-declare-module": false,
"no-declare-current-package": false
"interface-name": false
}
}