Compare commits

...

3 Commits

Author SHA1 Message Date
Derrick Hammer 1d4cb917c5
*update dist 2023-02-25 22:49:50 -05:00
Derrick Hammer 08b4bbc893
*make alias types optional 2023-02-25 22:49:34 -05:00
Derrick Hammer 3b7be7e892
*alias close to end 2023-02-25 22:48:57 -05:00
3 changed files with 10 additions and 6 deletions

7
dist/socket.d.ts vendored
View File

@ -18,9 +18,10 @@ export default class Socket extends Duplex {
writable: true;
remotePublicKey: Uint8Array;
private _emulateWebsocket;
addEventListener: typeof this.addListener;
removeEventListener: typeof this.removeListener;
send: typeof this.write;
addEventListener?: typeof this.addListener;
removeEventListener?: typeof this.removeListener;
send?: typeof this.write;
close?: typeof this.end;
constructor({ allowHalfOpen, remoteAddress, remotePort, remotePublicKey, write, emulateWebsocket, }?: SocketOptions);
private _connecting;
get connecting(): boolean;

1
dist/socket.js vendored
View File

@ -29,6 +29,7 @@ class Socket extends streamx_1.Duplex {
this.addEventListener = this.addListener;
this.removeEventListener = this.removeListener;
this.send = this.write;
this.close = this.end;
this.addEventListener("data", (data) =>
// @ts-ignore
this.emit("message", new MessageEvent("data", { data })));

View File

@ -32,9 +32,10 @@ export default class Socket extends Duplex {
public remotePublicKey: Uint8Array;
private _emulateWebsocket: boolean;
declare addEventListener: typeof this.addListener;
declare removeEventListener: typeof this.removeListener;
declare send: typeof this.write;
declare addEventListener?: typeof this.addListener;
declare removeEventListener?: typeof this.removeListener;
declare send?: typeof this.write;
declare close?: typeof this.end;
constructor({
allowHalfOpen = false,
@ -64,6 +65,7 @@ export default class Socket extends Duplex {
this.addEventListener = this.addListener;
this.removeEventListener = this.removeListener;
this.send = this.write;
this.close = this.end;
this.addEventListener("data", (data: any) =>
// @ts-ignore
this.emit("message", new MessageEvent("data", { data }))