mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-11 11:34:12 +08:00
Fix for hemera types
This commit is contained in:
13
types/nats-hemera/index.d.ts
vendored
13
types/nats-hemera/index.d.ts
vendored
@@ -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;
|
||||
|
||||
17
types/nats-hemera/nats-hemera-tests.ts
Normal file
17
types/nats-hemera/nats-hemera-tests.ts
Normal 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) {
|
||||
//....
|
||||
})
|
||||
})
|
||||
22
types/nats-hemera/tsconfig.json
Normal file
22
types/nats-hemera/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/nats-hemera/tslint.json
Normal file
1
types/nats-hemera/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user