@sprucelabs/spruce-heartwood-utils 24.0.3 → 24.1.1

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.
@@ -2,6 +2,7 @@ import EventEmitter from 'events';
2
2
  import { CachedValue, Device, TheaterSettingValueTypes, TheatreSettingName } from '@sprucelabs/heartwood-view-controllers';
3
3
  import { Orientation } from '../types/heartwood.types';
4
4
  export declare class HeartwoodDevice extends EventEmitter implements Device {
5
+ static Class?: new (storage: Storage) => Device;
5
6
  private storage;
6
7
  private orientation;
7
8
  private isGettingTheatreSetting;
@@ -19,8 +19,9 @@ class HeartwoodDevice extends events_1.default {
19
19
  });
20
20
  }
21
21
  static Device(storage) {
22
+ var _a;
22
23
  (0, schema_1.assertOptions)({ storage }, ['storage']);
23
- return new this(storage);
24
+ return new ((_a = this.Class) !== null && _a !== void 0 ? _a : this)(storage);
24
25
  }
25
26
  setCachedValue(key, value) {
26
27
  this.storage.setItem(key, JSON.stringify({ value }));
@@ -2,6 +2,7 @@ import EventEmitter from 'events';
2
2
  import { CachedValue, Device, TheaterSettingValueTypes, TheatreSettingName } from '@sprucelabs/heartwood-view-controllers';
3
3
  import { Orientation } from '../types/heartwood.types';
4
4
  export declare class HeartwoodDevice extends EventEmitter implements Device {
5
+ static Class?: new (storage: Storage) => Device;
5
6
  private storage;
6
7
  private orientation;
7
8
  private isGettingTheatreSetting;
@@ -22,8 +22,9 @@ export class HeartwoodDevice extends EventEmitter {
22
22
  });
23
23
  }
24
24
  static Device(storage) {
25
+ var _a;
25
26
  assertOptions({ storage }, ['storage']);
26
- return new this(storage);
27
+ return new ((_a = this.Class) !== null && _a !== void 0 ? _a : this)(storage);
27
28
  }
28
29
  setCachedValue(key, value) {
29
30
  this.storage.setItem(key, JSON.stringify({ value }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-heartwood-utils",
3
3
  "description": "Heartwood Utilities",
4
- "version": "24.0.3",
4
+ "version": "24.1.1",
5
5
  "skill": {
6
6
  "namespace": "heartwood"
7
7
  },