brilliantsole 0.0.12 → 0.0.13
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/build/brilliantsole.cjs +33 -0
- package/build/brilliantsole.cjs.map +1 -1
- package/build/brilliantsole.js +33 -0
- package/build/brilliantsole.js.map +1 -1
- package/build/brilliantsole.ls.js +33 -0
- package/build/brilliantsole.ls.js.map +1 -1
- package/build/brilliantsole.min.js +1 -1
- package/build/brilliantsole.min.js.map +1 -1
- package/build/brilliantsole.module.d.ts +6 -0
- package/build/brilliantsole.module.js +33 -0
- package/build/brilliantsole.module.js.map +1 -1
- package/build/brilliantsole.module.min.d.ts +6 -0
- package/build/brilliantsole.module.min.js +1 -1
- package/build/brilliantsole.module.min.js.map +1 -1
- package/build/brilliantsole.node.module.d.ts +6 -0
- package/build/brilliantsole.node.module.js +33 -0
- package/build/brilliantsole.node.module.js.map +1 -1
- package/build/dts/Device.d.ts +2 -0
- package/build/dts/DeviceManager.d.ts +2 -0
- package/build/dts/devicePair/DevicePair.d.ts +2 -0
- package/build/dts/utils/EventDispatcher.d.ts +2 -0
- package/build/index.d.ts +8 -0
- package/build/index.node.d.ts +8 -0
- package/package.json +1 -1
- package/src/Device.ts +6 -0
- package/src/DeviceManager.ts +6 -0
- package/src/devicePair/DevicePair.ts +6 -0
- package/src/utils/EventDispatcher.ts +18 -0
package/build/brilliantsole.cjs
CHANGED
|
@@ -192,6 +192,8 @@ class EventDispatcher {
|
|
|
192
192
|
this.listeners = {};
|
|
193
193
|
this.addEventListener = this.addEventListener.bind(this);
|
|
194
194
|
this.removeEventListener = this.removeEventListener.bind(this);
|
|
195
|
+
this.removeEventListeners = this.removeEventListeners.bind(this);
|
|
196
|
+
this.removeAllEventListeners = this.removeAllEventListeners.bind(this);
|
|
195
197
|
this.dispatchEvent = this.dispatchEvent.bind(this);
|
|
196
198
|
this.waitForEvent = this.waitForEvent.bind(this);
|
|
197
199
|
}
|
|
@@ -243,6 +245,19 @@ class EventDispatcher {
|
|
|
243
245
|
});
|
|
244
246
|
this.updateEventListeners(type);
|
|
245
247
|
}
|
|
248
|
+
removeEventListeners(type) {
|
|
249
|
+
if (!this.isValidEventType(type)) {
|
|
250
|
+
throw new Error(`Invalid event type: ${type}`);
|
|
251
|
+
}
|
|
252
|
+
if (!this.listeners[type])
|
|
253
|
+
return;
|
|
254
|
+
_console$A.log(`removing "${type}" listeners...`);
|
|
255
|
+
this.listeners[type] = [];
|
|
256
|
+
}
|
|
257
|
+
removeAllEventListeners() {
|
|
258
|
+
_console$A.log(`removing listeners...`);
|
|
259
|
+
this.listeners = {};
|
|
260
|
+
}
|
|
246
261
|
dispatchEvent(type, message) {
|
|
247
262
|
if (!this.isValidEventType(type)) {
|
|
248
263
|
throw new Error(`Invalid event type: ${type}`);
|
|
@@ -3994,6 +4009,12 @@ class DeviceManager {
|
|
|
3994
4009
|
get RemoveEventListener() {
|
|
3995
4010
|
return __classPrivateFieldGet(this, _DeviceManager_EventDispatcher, "f").removeEventListener;
|
|
3996
4011
|
}
|
|
4012
|
+
get RemoveEventListeners() {
|
|
4013
|
+
return __classPrivateFieldGet(this, _DeviceManager_EventDispatcher, "f").removeEventListeners;
|
|
4014
|
+
}
|
|
4015
|
+
get RemoveAllEventListeners() {
|
|
4016
|
+
return __classPrivateFieldGet(this, _DeviceManager_EventDispatcher, "f").removeAllEventListeners;
|
|
4017
|
+
}
|
|
3997
4018
|
}
|
|
3998
4019
|
_DeviceManager_boundDeviceEventListeners = new WeakMap(), _DeviceManager_ConnectedDevices = new WeakMap(), _DeviceManager_UseLocalStorage = new WeakMap(), _DeviceManager_DefaultLocalStorageConfiguration = new WeakMap(), _DeviceManager_LocalStorageConfiguration = new WeakMap(), _DeviceManager_LocalStorageKey = new WeakMap(), _DeviceManager_AvailableDevices = new WeakMap(), _DeviceManager_EventDispatcher = new WeakMap(), _DeviceManager_instances = new WeakSet(), _DeviceManager_onDeviceType = function _DeviceManager_onDeviceType(event) {
|
|
3999
4020
|
if (__classPrivateFieldGet(this, _DeviceManager_UseLocalStorage, "f")) {
|
|
@@ -4213,6 +4234,12 @@ class Device {
|
|
|
4213
4234
|
get waitForEvent() {
|
|
4214
4235
|
return __classPrivateFieldGet(this, _Device_eventDispatcher, "f").waitForEvent;
|
|
4215
4236
|
}
|
|
4237
|
+
get removeEventListeners() {
|
|
4238
|
+
return __classPrivateFieldGet(this, _Device_eventDispatcher, "f").removeEventListeners;
|
|
4239
|
+
}
|
|
4240
|
+
get removeAllEventListeners() {
|
|
4241
|
+
return __classPrivateFieldGet(this, _Device_eventDispatcher, "f").removeAllEventListeners;
|
|
4242
|
+
}
|
|
4216
4243
|
get connectionManager() {
|
|
4217
4244
|
return __classPrivateFieldGet(this, _Device_connectionManager, "f");
|
|
4218
4245
|
}
|
|
@@ -4756,6 +4783,12 @@ class DevicePair {
|
|
|
4756
4783
|
get waitForEvent() {
|
|
4757
4784
|
return __classPrivateFieldGet(this, _DevicePair_eventDispatcher, "f").waitForEvent;
|
|
4758
4785
|
}
|
|
4786
|
+
get removeEventListeners() {
|
|
4787
|
+
return __classPrivateFieldGet(this, _DevicePair_eventDispatcher, "f").removeEventListeners;
|
|
4788
|
+
}
|
|
4789
|
+
get removeAllEventListeners() {
|
|
4790
|
+
return __classPrivateFieldGet(this, _DevicePair_eventDispatcher, "f").removeAllEventListeners;
|
|
4791
|
+
}
|
|
4759
4792
|
get left() {
|
|
4760
4793
|
return __classPrivateFieldGet(this, _DevicePair_left, "f");
|
|
4761
4794
|
}
|