mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 00:13:13 +09:00
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:
1 parent
6d523096ce
commit
5ec7c9f99c
7 files changed
+25
-39
No files matched your search
@@ -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 });
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
Reference in new issue
Block a user