@phpsandbox/sdk 0.0.23 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/phpsandbox-sdk.esm.js +18 -14
- package/dist/browser/phpsandbox-sdk.esm.js.map +2 -2
- package/dist/browser/phpsandbox-sdk.esm.min.js +2 -2
- package/dist/browser/phpsandbox-sdk.esm.min.js.map +3 -3
- package/dist/browser/phpsandbox-sdk.iife.js +18 -14
- package/dist/browser/phpsandbox-sdk.iife.js.map +2 -2
- package/dist/browser/phpsandbox-sdk.iife.min.js +2 -2
- package/dist/browser/phpsandbox-sdk.iife.min.js.map +3 -3
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +11 -13
- package/dist/events/index.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -7
- package/dist/index.js.map +1 -1
- package/dist/socket/index.d.ts +4 -0
- package/dist/socket/index.d.ts.map +1 -1
- package/dist/socket/index.js +6 -0
- package/dist/socket/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -3072,6 +3072,12 @@ var PHPSandbox = (() => {
|
|
|
3072
3072
|
console[level](`[Transport ${timestamp}] ${message}${logData ? "\n" + logData : ""}`);
|
|
3073
3073
|
}
|
|
3074
3074
|
}
|
|
3075
|
+
/**
|
|
3076
|
+
* Ensure the websocket is open without requiring an application-level roundtrip.
|
|
3077
|
+
*/
|
|
3078
|
+
connect() {
|
|
3079
|
+
return __privateMethod(this, _Transport_instances, connect_fn).call(this);
|
|
3080
|
+
}
|
|
3075
3081
|
id() {
|
|
3076
3082
|
return this.clientId;
|
|
3077
3083
|
}
|
|
@@ -3804,39 +3810,37 @@ var PHPSandbox = (() => {
|
|
|
3804
3810
|
};
|
|
3805
3811
|
return inst;
|
|
3806
3812
|
}
|
|
3807
|
-
var EE = mittWithOnce();
|
|
3808
3813
|
var EventManager = class _EventManager {
|
|
3814
|
+
constructor() {
|
|
3815
|
+
this.emitter = mittWithOnce();
|
|
3816
|
+
}
|
|
3809
3817
|
listen(event, callback) {
|
|
3810
3818
|
const dispose = () => {
|
|
3811
3819
|
this.removeListener(event, callback);
|
|
3812
3820
|
};
|
|
3813
|
-
|
|
3821
|
+
this.emitter.on(event, callback);
|
|
3814
3822
|
return { dispose };
|
|
3815
3823
|
}
|
|
3816
3824
|
emit(event, data) {
|
|
3817
|
-
|
|
3825
|
+
this.emitter.emit(event, data);
|
|
3818
3826
|
}
|
|
3819
3827
|
once(event, callback) {
|
|
3820
|
-
|
|
3828
|
+
this.emitter.once(event, callback);
|
|
3821
3829
|
}
|
|
3822
3830
|
static make() {
|
|
3823
|
-
return
|
|
3831
|
+
return new _EventManager();
|
|
3824
3832
|
}
|
|
3825
3833
|
static refresh() {
|
|
3826
|
-
|
|
3827
|
-
EE = mittWithOnce();
|
|
3828
|
-
return _EventManager.instance = new _EventManager();
|
|
3834
|
+
return new _EventManager();
|
|
3829
3835
|
}
|
|
3830
3836
|
removeListener(event, callbackSignature) {
|
|
3831
|
-
|
|
3837
|
+
this.emitter.off(event, callbackSignature);
|
|
3832
3838
|
}
|
|
3833
3839
|
static createInstance() {
|
|
3834
|
-
|
|
3835
|
-
_EventManager.instance = new _EventManager();
|
|
3836
|
-
return _EventManager.instance;
|
|
3840
|
+
return new _EventManager();
|
|
3837
3841
|
}
|
|
3838
3842
|
inspect() {
|
|
3839
|
-
return
|
|
3843
|
+
return this.emitter.all;
|
|
3840
3844
|
}
|
|
3841
3845
|
};
|
|
3842
3846
|
|
|
@@ -4716,7 +4720,7 @@ var PHPSandbox = (() => {
|
|
|
4716
4720
|
async ready() {
|
|
4717
4721
|
const ready = async () => {
|
|
4718
4722
|
if (this.client.options.startClosed && !this.socket.isConnected) {
|
|
4719
|
-
await this.socket.
|
|
4723
|
+
await this.socket.connect();
|
|
4720
4724
|
}
|
|
4721
4725
|
return __privateGet(this, _initPromise);
|
|
4722
4726
|
};
|