Skip to content

Commit

Permalink
fix: typings
Browse files Browse the repository at this point in the history
  • Loading branch information
izatop committed May 24, 2021
1 parent 9b7005b commit dc5722e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/unit/src/Runtime/Heartbeat.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {AsyncState} from "@bunt/util";
import {HeartbeatDisposer, IRunnable} from "./interfaces";

const registry = new WeakMap<any, Heartbeat>();
const registry = new WeakMap<IRunnable, Heartbeat>();

export class Heartbeat {
#beats = true;
Expand All @@ -26,7 +26,7 @@ export class Heartbeat {
* @param target
* @param disposer
*/
public static create(target: unknown, disposer?: HeartbeatDisposer): Heartbeat {
public static create(target: IRunnable, disposer?: HeartbeatDisposer): Heartbeat {
const heartbeat = registry.get(target) ?? new Heartbeat(disposer);
if (!registry.has(target)) {
registry.set(target, heartbeat);
Expand All @@ -40,7 +40,7 @@ export class Heartbeat {
return heartbeat.watch();
}

public static destroy(target: unknown): void {
public static destroy(target: IRunnable): void {
const heartbeat = registry.get(target);
heartbeat?.destroy();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/util/src/Logger/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class Logger {
: groupId;
}

public get label() {
public get label(): string {
return this.#label;
}

Expand Down

0 comments on commit dc5722e

Please sign in to comment.