Fix bad typings in lib

These were missed or broken in the in the inital porting of lib to
TypeScript.
This commit is contained in:
Hornwitser committed 2023-08-12 19:59:44 +02:00
1 parent 6d523096ce
commit 5ec7c9f99c
7 files changed
+25 -39

No files matched your search

+1 -1
View File
@@ -340,7 +340,7 @@ export abstract class WebSocketClientConnector extends WebSocketBaseConnector {
constructor(
protected _url: string,
maxReconnectDelay: number,
protected _tlsCa = null
protected _tlsCa: string | undefined,
) {
super(undefined as any, new libData.Address(libData.Address.controller, 0));
this._backoff = new ExponentialBackoff({ max: maxReconnectDelay });
+3 -3
View File
@@ -67,8 +67,8 @@ interface EventEntry {
allowedDstTypes: Set<number>;
eventFromJSON: (json: any) => Event<unknown>;
}
type RequestHandler<Req, Res> = (request: Request<Req, Res>, src: libData.Address, dst: libData.Address) => any;
type EventHandler<T> = (event: Event<T>, src: libData.Address, dst: libData.Address) => any;
type RequestHandler<Req, Res> = (request: Req, src: libData.Address, dst: libData.Address) => Promise<Res>;
type EventHandler<T> = (event: T, src: libData.Address, dst: libData.Address) => Promise<void>;
interface Router {
forwardMessage(origin: Link, message: Message, fallback: boolean): boolean,
@@ -99,7 +99,7 @@ export class Link {
constructor(
public connector: BaseConnector
) {
this.handle(libData.PingRequest, () => {});
this.handle(libData.PingRequest, async () => {});
// Process messages received by the connector
connector.on("message", payload => {