Chore: Add callbacks to eureka-js-client methods

This commit is contained in:
Tom Barton
2018-12-12 10:36:45 +00:00
parent cca60bd544
commit 4e8fd2a734
2 changed files with 13 additions and 3 deletions
@@ -43,3 +43,11 @@ const newerClient = new Eureka({
port: 32768,
}
});
// Test callbacks
newerClient.start((err: Error) => {});
newerClient.start(() => {});
newerClient.start();
newerClient.stop((err: Error) => {});
newerClient.start(() => {});
newerClient.stop();
+5 -3
View File
@@ -1,12 +1,14 @@
// Type definitions for eureka-js-client 4.4
// Project: https://github.com/jquatier/eureka-js-client
// Definitions by: Ilko Hoffmann <https://github.com/Schnillz>, Karl O. <https://github.com/karl-run>
// Definitions by: Ilko Hoffmann <https://github.com/Schnillz>
// Karl O. <https://github.com/karl-run>
// Tom Barton <https://github.com/tombarton>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export class Eureka {
constructor(config: EurekaClient.EurekaConfig)
start(): void;
stop(): void;
start(cb?: (err?: Error) => void): void;
stop(cb?: (err?: Error) => void): void;
getInstancesByAppId(appId: string): string[];
getInstancesByVipAddress(vidAddress: string): string [];
}