@titan-os/sdk 1.10.3 → 1.11.0
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/cjs/sdk.js +1 -1
- package/dist/esm/sdk.js +73 -10
- package/dist/types/sdk.d.ts +37 -0
- package/dist/umd/sdk.js +1 -1
- package/package.json +1 -1
package/dist/esm/sdk.js
CHANGED
|
@@ -641,7 +641,7 @@ const matchBrandFromUserAgent = (userAgent, regex) => {
|
|
|
641
641
|
const match = userAgent.match(regex);
|
|
642
642
|
return match ? match[1] : null;
|
|
643
643
|
};
|
|
644
|
-
const VERSION = "1.
|
|
644
|
+
const VERSION = "1.11.0";
|
|
645
645
|
var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
|
|
646
646
|
ErrorCode2["NOT_INITIALIZED"] = "NOT_INITIALIZED";
|
|
647
647
|
ErrorCode2["NOT_SUPPORTED"] = "NOT_SUPPORTED";
|
|
@@ -3257,6 +3257,45 @@ class BrowserAccessibilityService {
|
|
|
3257
3257
|
log$t.info("TM settings updated:", this.tmSettings);
|
|
3258
3258
|
}
|
|
3259
3259
|
}
|
|
3260
|
+
const BASE_KEY_CODES = {
|
|
3261
|
+
BACK: { key: "Backspace", keyCode: 8 },
|
|
3262
|
+
ENTER: { key: "Enter", keyCode: 13 },
|
|
3263
|
+
LEFT: { key: "ArrowLeft", keyCode: 37 },
|
|
3264
|
+
DOWN: { key: "ArrowDown", keyCode: 40 },
|
|
3265
|
+
RIGHT: { key: "ArrowRight", keyCode: 39 },
|
|
3266
|
+
UP: { key: "ArrowUp", keyCode: 38 },
|
|
3267
|
+
DIGIT_0: { key: "Numpad0", keyCode: 48 },
|
|
3268
|
+
DIGIT_1: { key: "Numpad1", keyCode: 49 },
|
|
3269
|
+
DIGIT_2: { key: "Numpad2", keyCode: 50 },
|
|
3270
|
+
DIGIT_3: { key: "Numpad3", keyCode: 51 },
|
|
3271
|
+
DIGIT_4: { key: "Numpad4", keyCode: 52 },
|
|
3272
|
+
DIGIT_5: { key: "Numpad5", keyCode: 53 },
|
|
3273
|
+
DIGIT_6: { key: "Numpad6", keyCode: 54 },
|
|
3274
|
+
DIGIT_7: { key: "Numpad7", keyCode: 55 },
|
|
3275
|
+
DIGIT_8: { key: "Numpad8", keyCode: 56 },
|
|
3276
|
+
DIGIT_9: { key: "Numpad9", keyCode: 57 },
|
|
3277
|
+
RED: { key: "ColorF0Red", keyCode: 403 },
|
|
3278
|
+
GREEN: { key: "ColorF1Green", keyCode: 404 },
|
|
3279
|
+
YELLOW: { key: "ColorF2Yellow", keyCode: 405 },
|
|
3280
|
+
BLUE: { key: "ColorF3Blue", keyCode: 406 },
|
|
3281
|
+
PLAY: { key: "MediaPlay", keyCode: 415 },
|
|
3282
|
+
PAUSE: { key: "MediaPause", keyCode: 19 },
|
|
3283
|
+
PLAY_PAUSE: { key: "MediaPlayPause", keyCode: 179 },
|
|
3284
|
+
STOP: { key: "MediaStop", keyCode: 413 },
|
|
3285
|
+
FAST_FWD: { key: "MediaTrackNext", keyCode: 417 },
|
|
3286
|
+
REWIND: { key: "MediaRewind", keyCode: 412 },
|
|
3287
|
+
CHANNEL_UP: { key: "PageUp", keyCode: 33 },
|
|
3288
|
+
CHANNEL_DOWN: { key: "PageDown", keyCode: 34 }
|
|
3289
|
+
};
|
|
3290
|
+
const TPV_KEY_CODES = {
|
|
3291
|
+
...BASE_KEY_CODES
|
|
3292
|
+
// BACK keyCode: 8 (default)
|
|
3293
|
+
};
|
|
3294
|
+
const VESTEL_KEY_CODES = {
|
|
3295
|
+
...BASE_KEY_CODES,
|
|
3296
|
+
BACK: { key: "Backspace", keyCode: 461 }
|
|
3297
|
+
};
|
|
3298
|
+
const BROWSER_KEY_CODES = TPV_KEY_CODES;
|
|
3260
3299
|
class BasePlatform {
|
|
3261
3300
|
constructor(config) {
|
|
3262
3301
|
__publicField(this, "config");
|
|
@@ -3402,6 +3441,9 @@ class BrowserDeviceInfoService {
|
|
|
3402
3441
|
throw error;
|
|
3403
3442
|
}
|
|
3404
3443
|
}
|
|
3444
|
+
getKeyCodes() {
|
|
3445
|
+
return BROWSER_KEY_CODES;
|
|
3446
|
+
}
|
|
3405
3447
|
}
|
|
3406
3448
|
const log$r = getLogger("BrowserAppControlService");
|
|
3407
3449
|
class BrowserAppControlService {
|
|
@@ -3528,7 +3570,8 @@ class BrowserSDK {
|
|
|
3528
3570
|
__publicField(this, "appControlService");
|
|
3529
3571
|
__publicField(this, "deviceInfo", {
|
|
3530
3572
|
getDeviceInfo: () => this.deviceInfoService.getDeviceInfo(),
|
|
3531
|
-
getCapabilities: () => this.deviceInfoService.getCapabilities()
|
|
3573
|
+
getCapabilities: () => this.deviceInfoService.getCapabilities(),
|
|
3574
|
+
getKeyCodes: () => this.deviceInfoService.getKeyCodes()
|
|
3532
3575
|
});
|
|
3533
3576
|
__publicField(this, "accessibility", {
|
|
3534
3577
|
enableReader: (config) => this.accessibilityService.enableReader(config),
|
|
@@ -5417,6 +5460,9 @@ class TPVLegacyDeviceInfoService {
|
|
|
5417
5460
|
}
|
|
5418
5461
|
return this.info.Capability;
|
|
5419
5462
|
}
|
|
5463
|
+
getKeyCodes() {
|
|
5464
|
+
return TPV_KEY_CODES;
|
|
5465
|
+
}
|
|
5420
5466
|
}
|
|
5421
5467
|
class TPVLegacySDK {
|
|
5422
5468
|
constructor(options) {
|
|
@@ -5425,7 +5471,8 @@ class TPVLegacySDK {
|
|
|
5425
5471
|
__publicField(this, "appControlService");
|
|
5426
5472
|
__publicField(this, "deviceInfo", {
|
|
5427
5473
|
getDeviceInfo: () => this.deviceInfoService.getDeviceInfo(),
|
|
5428
|
-
getCapabilities: () => this.deviceInfoService.getCapabilities()
|
|
5474
|
+
getCapabilities: () => this.deviceInfoService.getCapabilities(),
|
|
5475
|
+
getKeyCodes: () => this.deviceInfoService.getKeyCodes()
|
|
5429
5476
|
});
|
|
5430
5477
|
__publicField(this, "accessibility", {
|
|
5431
5478
|
enableReader: (config) => this.accessibilityService.enableReader(config),
|
|
@@ -6045,6 +6092,9 @@ class VestelLegacyDeviceInfoService extends BaseDeviceInfoService {
|
|
|
6045
6092
|
getLogger() {
|
|
6046
6093
|
return log$h;
|
|
6047
6094
|
}
|
|
6095
|
+
getKeyCodes() {
|
|
6096
|
+
return VESTEL_KEY_CODES;
|
|
6097
|
+
}
|
|
6048
6098
|
}
|
|
6049
6099
|
const log$g = getLogger("VestelLegacyAccessibilityService");
|
|
6050
6100
|
class VestelLegacyAccessibilityService {
|
|
@@ -6123,7 +6173,8 @@ class VestelLegacySDK {
|
|
|
6123
6173
|
__publicField(this, "loggingService");
|
|
6124
6174
|
__publicField(this, "deviceInfo", {
|
|
6125
6175
|
getDeviceInfo: () => this.deviceInfoService.getDeviceInfo(),
|
|
6126
|
-
getCapabilities: () => this.deviceInfoService.getCapabilities()
|
|
6176
|
+
getCapabilities: () => this.deviceInfoService.getCapabilities(),
|
|
6177
|
+
getKeyCodes: () => this.deviceInfoService.getKeyCodes()
|
|
6127
6178
|
});
|
|
6128
6179
|
__publicField(this, "accessibility", {
|
|
6129
6180
|
enableReader: (config) => this.accessibilityService.enableReader(config),
|
|
@@ -6248,14 +6299,15 @@ class AnalyticsService {
|
|
|
6248
6299
|
}
|
|
6249
6300
|
}
|
|
6250
6301
|
const log$c = getLogger("WrapperUtils");
|
|
6251
|
-
function createDeviceInfoWrapper(initProvider, onDeviceInfoFetched) {
|
|
6302
|
+
function createDeviceInfoWrapper(initProvider, keyCodes, onDeviceInfoFetched) {
|
|
6252
6303
|
return {
|
|
6253
6304
|
getDeviceInfo: async () => {
|
|
6254
6305
|
const instance = await initProvider();
|
|
6255
6306
|
const deviceInfo = await instance.deviceInfo.getDeviceInfo();
|
|
6256
6307
|
onDeviceInfoFetched?.(deviceInfo);
|
|
6257
6308
|
return deviceInfo;
|
|
6258
|
-
}
|
|
6309
|
+
},
|
|
6310
|
+
getKeyCodes: () => keyCodes
|
|
6259
6311
|
};
|
|
6260
6312
|
}
|
|
6261
6313
|
function createAccessibilityWrapper(initProvider) {
|
|
@@ -6740,6 +6792,9 @@ class TPVDeviceInfoService {
|
|
|
6740
6792
|
}
|
|
6741
6793
|
return this.info.Capability;
|
|
6742
6794
|
}
|
|
6795
|
+
getKeyCodes() {
|
|
6796
|
+
return TPV_KEY_CODES;
|
|
6797
|
+
}
|
|
6743
6798
|
}
|
|
6744
6799
|
const log$8 = getLogger("TPVAppControlService");
|
|
6745
6800
|
class TPVAppControlService {
|
|
@@ -6770,7 +6825,8 @@ class BaseSDK {
|
|
|
6770
6825
|
__publicField(this, "appControlService");
|
|
6771
6826
|
__publicField(this, "deviceInfo", {
|
|
6772
6827
|
getDeviceInfo: () => this.deviceInfoService.getDeviceInfo(),
|
|
6773
|
-
getCapabilities: () => this.deviceInfoService.getCapabilities()
|
|
6828
|
+
getCapabilities: () => this.deviceInfoService.getCapabilities(),
|
|
6829
|
+
getKeyCodes: () => this.deviceInfoService.getKeyCodes()
|
|
6774
6830
|
});
|
|
6775
6831
|
__publicField(this, "accessibility", {
|
|
6776
6832
|
enableReader: (config) => this.accessibilityService.enableReader(config),
|
|
@@ -7329,6 +7385,9 @@ class VestelDeviceInfoService {
|
|
|
7329
7385
|
}
|
|
7330
7386
|
return this.info.Capability;
|
|
7331
7387
|
}
|
|
7388
|
+
getKeyCodes() {
|
|
7389
|
+
return VESTEL_KEY_CODES;
|
|
7390
|
+
}
|
|
7332
7391
|
}
|
|
7333
7392
|
const log$2 = getLogger("VestelAppControlService");
|
|
7334
7393
|
class VestelAppControlService {
|
|
@@ -7493,9 +7552,13 @@ const getTitanSDK = (options) => {
|
|
|
7493
7552
|
const sdkWrapper = {
|
|
7494
7553
|
VERSION,
|
|
7495
7554
|
isReady: initPromise,
|
|
7496
|
-
deviceInfo: createDeviceInfoWrapper(
|
|
7497
|
-
|
|
7498
|
-
|
|
7555
|
+
deviceInfo: createDeviceInfoWrapper(
|
|
7556
|
+
ensureInitialized,
|
|
7557
|
+
sdkInstance.deviceInfo.getKeyCodes(),
|
|
7558
|
+
(info) => {
|
|
7559
|
+
cachedDeviceInfo = info;
|
|
7560
|
+
}
|
|
7561
|
+
),
|
|
7499
7562
|
accessibility: createAccessibilityWrapper(ensureInitialized),
|
|
7500
7563
|
apps: createAppsWrapper(ensureInitialized)
|
|
7501
7564
|
};
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -70,6 +70,42 @@ export declare const getDeviceInfo: () => Promise<DeviceInfo>;
|
|
|
70
70
|
|
|
71
71
|
export declare const getTitanSDK: (options?: SDKOptions) => TitanSDK;
|
|
72
72
|
|
|
73
|
+
declare interface KeyCodeEntry {
|
|
74
|
+
key: string;
|
|
75
|
+
keyCode: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare interface KeyCodesMap {
|
|
79
|
+
BACK: KeyCodeEntry;
|
|
80
|
+
ENTER: KeyCodeEntry;
|
|
81
|
+
LEFT: KeyCodeEntry;
|
|
82
|
+
DOWN: KeyCodeEntry;
|
|
83
|
+
RIGHT: KeyCodeEntry;
|
|
84
|
+
UP: KeyCodeEntry;
|
|
85
|
+
DIGIT_0: KeyCodeEntry;
|
|
86
|
+
DIGIT_1: KeyCodeEntry;
|
|
87
|
+
DIGIT_2: KeyCodeEntry;
|
|
88
|
+
DIGIT_3: KeyCodeEntry;
|
|
89
|
+
DIGIT_4: KeyCodeEntry;
|
|
90
|
+
DIGIT_5: KeyCodeEntry;
|
|
91
|
+
DIGIT_6: KeyCodeEntry;
|
|
92
|
+
DIGIT_7: KeyCodeEntry;
|
|
93
|
+
DIGIT_8: KeyCodeEntry;
|
|
94
|
+
DIGIT_9: KeyCodeEntry;
|
|
95
|
+
RED: KeyCodeEntry;
|
|
96
|
+
GREEN: KeyCodeEntry;
|
|
97
|
+
YELLOW: KeyCodeEntry;
|
|
98
|
+
BLUE: KeyCodeEntry;
|
|
99
|
+
PLAY: KeyCodeEntry;
|
|
100
|
+
PAUSE: KeyCodeEntry;
|
|
101
|
+
PLAY_PAUSE: KeyCodeEntry;
|
|
102
|
+
STOP: KeyCodeEntry;
|
|
103
|
+
FAST_FWD: KeyCodeEntry;
|
|
104
|
+
REWIND: KeyCodeEntry;
|
|
105
|
+
CHANNEL_UP: KeyCodeEntry;
|
|
106
|
+
CHANNEL_DOWN: KeyCodeEntry;
|
|
107
|
+
}
|
|
108
|
+
|
|
73
109
|
/**
|
|
74
110
|
* Platform detection types
|
|
75
111
|
*/
|
|
@@ -154,6 +190,7 @@ export declare interface TitanSDK {
|
|
|
154
190
|
isReady: Promise<boolean>;
|
|
155
191
|
deviceInfo: {
|
|
156
192
|
getDeviceInfo(): Promise<DeviceInfo>;
|
|
193
|
+
getKeyCodes(): KeyCodesMap;
|
|
157
194
|
};
|
|
158
195
|
accessibility: PublicAccessibilitySettings;
|
|
159
196
|
apps: {
|