Fix for hemera types

This commit is contained in:
Vladimir Djukic
2017-08-28 15:16:47 +02:00
parent 2242224e3c
commit 23869c2194
4 changed files with 50 additions and 3 deletions

View File

@@ -1,4 +1,13 @@
// Type definitions for natsort 1.0
// Project: https://github.com/hemerajs/hemera
// Definitions by: Melvin Groenhoff <https://github.com/vforv>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "nats-hemera" {
interface Hemera {
new (transport: object, config?: Config): CB;
}
type LogLevel =
'fatal' |
'error' |
@@ -66,9 +75,7 @@ declare module "nats-hemera" {
}
interface Hemera {
(transport: object, ): CB;
}
interface Pattern {
topic: string;

View File

@@ -0,0 +1,17 @@
import { Hemera } from 'nats-hemera';
const nats = {}
const hemera: any = new Hemera(nats, {});
hemera.ready(() => {
hemera.add({
topic: 'math',
cmd: 'add'
}, function (req:any, cb: any) {
//....
})
})

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"nats-hemera-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }