mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
chore: add type cast in nats emitter
This commit is contained in:
@@ -151,7 +151,7 @@ export class ClientNats extends ClientProxy<NatsEvents, NatsStatus> {
|
|||||||
EventKey extends keyof NatsEvents = keyof NatsEvents,
|
EventKey extends keyof NatsEvents = keyof NatsEvents,
|
||||||
EventCallback extends NatsEvents[EventKey] = NatsEvents[EventKey],
|
EventCallback extends NatsEvents[EventKey] = NatsEvents[EventKey],
|
||||||
>(event: EventKey, callback: EventCallback) {
|
>(event: EventKey, callback: EventCallback) {
|
||||||
this.statusEventEmitter.on(event, callback as any);
|
this.statusEventEmitter.on(event as string | symbol, callback as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
public unwrap<T>(): T {
|
public unwrap<T>(): T {
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ export class ServerNats<
|
|||||||
EventKey extends keyof E = keyof E,
|
EventKey extends keyof E = keyof E,
|
||||||
EventCallback extends E[EventKey] = E[EventKey],
|
EventCallback extends E[EventKey] = E[EventKey],
|
||||||
>(event: EventKey, callback: EventCallback) {
|
>(event: EventKey, callback: EventCallback) {
|
||||||
this.statusEventEmitter.on(event, callback as any);
|
this.statusEventEmitter.on(event as string | symbol, callback as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected initializeSerializer(options: NatsOptions['options']) {
|
protected initializeSerializer(options: NatsOptions['options']) {
|
||||||
|
|||||||
Reference in New Issue
Block a user