Compare commits

...

2 Commits

Author SHA1 Message Date
Derrick Hammer b14509d6f1
*Update dist 2023-03-02 05:41:30 -05:00
Derrick Hammer b3a7c0b4e1
*Add getter for channel 2023-03-02 05:41:13 -05:00
3 changed files with 12 additions and 4 deletions

3
dist/peer.d.ts vendored
View File

@ -42,7 +42,8 @@ export default class Peer {
private _onsend; private _onsend;
private _onclose; private _onclose;
private _emulateWebsocket; private _emulateWebsocket;
private _channel?;
constructor({ proxy, peer, muxer, onopen, onreceive, onsend, onclose, emulateWebsocket, }: PeerOptionsWithProxy & DataSocketOptions); constructor({ proxy, peer, muxer, onopen, onreceive, onsend, onclose, emulateWebsocket, }: PeerOptionsWithProxy & DataSocketOptions);
private _channel?;
get channel(): any;
init(): Promise<void>; init(): Promise<void>;
} }

5
dist/peer.js vendored
View File

@ -15,7 +15,6 @@ class Peer {
_onsend; _onsend;
_onclose; _onclose;
_emulateWebsocket; _emulateWebsocket;
_channel;
constructor({ proxy, peer, muxer, onopen, onreceive, onsend, onclose, emulateWebsocket = false, }) { constructor({ proxy, peer, muxer, onopen, onreceive, onsend, onclose, emulateWebsocket = false, }) {
this._proxy = proxy; this._proxy = proxy;
this._peer = peer; this._peer = peer;
@ -26,6 +25,10 @@ class Peer {
this._onclose = onclose?.bind(undefined, this); this._onclose = onclose?.bind(undefined, this);
this._emulateWebsocket = emulateWebsocket; this._emulateWebsocket = emulateWebsocket;
} }
_channel;
get channel() {
return this._channel;
}
async init() { async init() {
const write = async (data, cb) => { const write = async (data, cb) => {
pipe.send(data); pipe.send(data);

View File

@ -56,8 +56,6 @@ export default class Peer {
private _onclose: OnCloseBound; private _onclose: OnCloseBound;
private _emulateWebsocket: boolean; private _emulateWebsocket: boolean;
private _channel?: any;
constructor({ constructor({
proxy, proxy,
peer, peer,
@ -78,6 +76,12 @@ export default class Peer {
this._emulateWebsocket = emulateWebsocket; this._emulateWebsocket = emulateWebsocket;
} }
private _channel?: any;
get channel(): any {
return this._channel;
}
async init() { async init() {
const write = async (data: any, cb: Function) => { const write = async (data: any, cb: Function) => {
pipe.send(data); pipe.send(data);