diff --git a/dist/socket.d.ts b/dist/socket.d.ts index 2b40c20..a66b676 100644 --- a/dist/socket.d.ts +++ b/dist/socket.d.ts @@ -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; diff --git a/dist/socket.js b/dist/socket.js index ad081b6..582d817 100644 --- a/dist/socket.js +++ b/dist/socket.js @@ -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 })));