@signageos/front-applet 8.1.2 → 8.1.4
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/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/docs/sos/browser.md +66 -14
- package/docs/sos/command.md +52 -6
- package/docs/sos/debug.md +21 -2
- package/docs/sos/deviceInfo.md +31 -0
- package/docs/sos/display.md +34 -3
- package/docs/sos/fileSystem.md +1135 -59
- package/docs/sos/hardware/barcodeScanner.md +58 -15
- package/docs/sos/hardware/index.md +72 -15
- package/docs/sos/hardware/led.md +32 -3
- package/docs/sos/index.md +3 -3
- package/docs/sos/input.md +42 -1
- package/docs/sos/monitors.md +8 -0
- package/docs/sos/native/mdc.md +69 -23
- package/docs/sos/offline/cache.md +376 -30
- package/docs/sos/offline/index.md +127 -24
- package/docs/sos/osd.md +8 -1
- package/docs/sos/proofOfPlay.md +28 -0
- package/docs/sos/stream.md +78 -78
- package/docs/sos/sync.md +228 -21
- package/docs/sos/video.md +73 -73
- package/docs/sos_management/app.md +11 -11
- package/docs/sos_management/audio.md +3 -3
- package/docs/sos_management/firmware.md +11 -11
- package/docs/sos_management/index.md +9 -9
- package/docs/sos_management/network.md +10 -10
- package/docs/sos_management/package.md +6 -6
- package/docs/sos_management/power.md +27 -27
- package/docs/sos_management/screen.md +17 -17
- package/docs/sos_management/security.md +3 -3
- package/docs/sos_management/time.md +8 -8
- package/docs/sos_management/wifi.md +12 -12
- package/es6/FrontApplet/Browser/Browser.d.ts +25 -9
- package/es6/FrontApplet/Browser/Browser.js +25 -9
- package/es6/FrontApplet/Browser/Browser.js.map +1 -1
- package/es6/FrontApplet/Browser/IOpenLinkOptions.d.ts +7 -0
- package/es6/FrontApplet/Browser/IOpenLinkOptions.js.map +1 -1
- package/es6/FrontApplet/Browser/events.d.ts +6 -0
- package/es6/FrontApplet/Browser/events.js.map +1 -1
- package/es6/FrontApplet/Command/Command.d.ts +15 -6
- package/es6/FrontApplet/Command/Command.js +15 -6
- package/es6/FrontApplet/Command/Command.js.map +1 -1
- package/es6/FrontApplet/Command/ICommand.d.ts +7 -0
- package/es6/FrontApplet/Command/ICommandEvent.d.ts +6 -0
- package/es6/FrontApplet/Debug/Debug.d.ts +11 -3
- package/es6/FrontApplet/Debug/Debug.js +11 -3
- package/es6/FrontApplet/Debug/Debug.js.map +1 -1
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.d.ts +19 -0
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js +20 -2
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js.map +1 -1
- package/es6/FrontApplet/Display/Display.d.ts +22 -14
- package/es6/FrontApplet/Display/Display.js +22 -14
- package/es6/FrontApplet/Display/Display.js.map +1 -1
- package/es6/FrontApplet/Display/IDisplay.d.ts +4 -0
- package/es6/FrontApplet/FileSystem/FileSystem.d.ts +429 -41
- package/es6/FrontApplet/FileSystem/FileSystem.js +427 -39
- package/es6/FrontApplet/FileSystem/FileSystem.js.map +1 -1
- package/es6/FrontApplet/FileSystem/HashAlgorithm.d.ts +4 -1
- package/es6/FrontApplet/FileSystem/types.d.ts +46 -0
- package/es6/FrontApplet/FileSystem/types.js.map +1 -1
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.d.ts +36 -8
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js +34 -2
- package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js.map +1 -1
- package/es6/FrontApplet/Hardware/BarcodeScanner/IBarcodeScanner.d.ts +5 -0
- package/es6/FrontApplet/Hardware/Hardware.d.ts +34 -5
- package/es6/FrontApplet/Hardware/Hardware.js +33 -5
- package/es6/FrontApplet/Hardware/Hardware.js.map +1 -1
- package/es6/FrontApplet/Hardware/ISerialPort.d.ts +17 -1
- package/es6/FrontApplet/Hardware/ISerialPortDataMessage.d.ts +3 -0
- package/es6/FrontApplet/Hardware/ISerialPortOptions.d.ts +6 -0
- package/es6/FrontApplet/Hardware/ISerialPortOptions.js +3 -0
- package/es6/FrontApplet/Hardware/ISerialPortOptions.js.map +1 -1
- package/es6/FrontApplet/Hardware/Led/Led.d.ts +19 -3
- package/es6/FrontApplet/Hardware/Led/Led.js +19 -3
- package/es6/FrontApplet/Hardware/Led/Led.js.map +1 -1
- package/es6/FrontApplet/Input/IKeyUpEvent.d.ts +9 -0
- package/es6/FrontApplet/Input/IKeyUpEvent.js +6 -0
- package/es6/FrontApplet/Input/IKeyUpEvent.js.map +1 -1
- package/es6/FrontApplet/Input/Input.d.ts +17 -1
- package/es6/FrontApplet/Input/Input.js +17 -1
- package/es6/FrontApplet/Input/Input.js.map +1 -1
- package/es6/FrontApplet/Monitors/Monitors.d.ts +5 -0
- package/es6/FrontApplet/Monitors/Monitors.js +5 -0
- package/es6/FrontApplet/Monitors/Monitors.js.map +1 -1
- package/es6/FrontApplet/NativeCommands/MDC/INativeMdcCommands.d.ts +1 -0
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.d.ts +32 -11
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.js +14 -11
- package/es6/FrontApplet/NativeCommands/MDC/Mdc.js.map +1 -1
- package/es6/FrontApplet/OSD/OSD.d.ts +5 -1
- package/es6/FrontApplet/OSD/OSD.js +5 -1
- package/es6/FrontApplet/OSD/OSD.js.map +1 -1
- package/es6/FrontApplet/Offline/Cache/Cache.d.ts +205 -28
- package/es6/FrontApplet/Offline/Cache/Cache.js +205 -28
- package/es6/FrontApplet/Offline/Cache/Cache.js.map +1 -1
- package/es6/FrontApplet/Offline/IAddFont.js.map +1 -1
- package/es6/FrontApplet/Offline/IFileType.js.map +1 -1
- package/es6/FrontApplet/Offline/ISaveFile.d.ts +3 -0
- package/es6/FrontApplet/Offline/ISaveFile.js.map +1 -1
- package/es6/FrontApplet/Offline/Offline.d.ts +58 -15
- package/es6/FrontApplet/Offline/Offline.js +56 -13
- package/es6/FrontApplet/Offline/Offline.js.map +1 -1
- package/es6/FrontApplet/ProofOfPlay/IRecordItemOptions.d.ts +3 -0
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.d.ts +15 -1
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js +15 -1
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js.map +1 -1
- package/es6/FrontApplet/Sync/Sync.d.ts +101 -18
- package/es6/FrontApplet/Sync/Sync.js +84 -10
- package/es6/FrontApplet/Sync/Sync.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSystem.js","sourceRoot":"","sources":["../../../src/FrontApplet/FileSystem/FileSystem.ts"],"names":[],"mappings":";;;;;AAAA,mCAAsC;AAEtC,
|
|
1
|
+
{"version":3,"file":"FileSystem.js","sourceRoot":"","sources":["../../../src/FrontApplet/FileSystem/FileSystem.ts"],"names":[],"mappings":";;;;;AAAA,mCAAsC;AAEtC,mCAWiB;AAEjB,oEAA4C;AAI5C,MAAM,2BAA2B,GAAG,uBAAuB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAqB,UAAU;IAOrB;IACA;IAPF,MAAM,CAAC,cAAc,GAAW,aAAa,CAAC;IAE7C,YAAY,CAAe;IAEnC,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;QAEtC,IAAI,CAAC,YAAY,GAAG,IAAI,qBAAY,EAAE,CAAC;IACxC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACI,KAAK,CAAC,gBAAgB;QAC5B,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YAC/C,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC;SAC3C,CAAC,CAAC;QACH,OAAO,YAAY,CAAC;IACrB,CAAC;IAED;;;;;;;;;;;;;;;OAeG;I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 'md5' | 'crc32' | AnyString;
|
|
@@ -1,8 +1,27 @@
|
|
|
1
|
+
import { AnyString } from '../../utils/types';
|
|
2
|
+
/**
|
|
3
|
+
* File System Storage Unit returned by the File System API.
|
|
4
|
+
*/
|
|
1
5
|
export interface IStorageUnit {
|
|
6
|
+
/**
|
|
7
|
+
* The type of the storage unit, e.g., "internal" or "external".
|
|
8
|
+
*/
|
|
2
9
|
type: string;
|
|
10
|
+
/**
|
|
11
|
+
* The total capacity of the storage unit in bytes.
|
|
12
|
+
*/
|
|
3
13
|
capacity: number;
|
|
14
|
+
/**
|
|
15
|
+
* The amount of free space available in the storage unit in bytes.
|
|
16
|
+
*/
|
|
4
17
|
freeSpace: number;
|
|
18
|
+
/**
|
|
19
|
+
* The amount of usable space in the storage unit in bytes.
|
|
20
|
+
*/
|
|
5
21
|
usableSpace: number;
|
|
22
|
+
/**
|
|
23
|
+
* Indicates whether the storage unit is removable (e.g., an SD card).
|
|
24
|
+
*/
|
|
6
25
|
removable: boolean;
|
|
7
26
|
}
|
|
8
27
|
export declare const VIStorageUnit: {
|
|
@@ -12,14 +31,41 @@ export declare const VIStorageUnit: {
|
|
|
12
31
|
usableSpace: string;
|
|
13
32
|
removable: string;
|
|
14
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Base File System interface for methods.
|
|
36
|
+
*/
|
|
15
37
|
export interface IFilePath {
|
|
38
|
+
/**
|
|
39
|
+
* Storage unit which is selected for performing file operations.
|
|
40
|
+
*/
|
|
16
41
|
storageUnit: IStorageUnit;
|
|
42
|
+
/**
|
|
43
|
+
* File path within the storage unit.
|
|
44
|
+
*/
|
|
17
45
|
filePath: string;
|
|
18
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Allowed extract method types for `extractFile()` operations.
|
|
49
|
+
*/
|
|
50
|
+
export type ExtractMethodType = 'zip' | AnyString;
|
|
51
|
+
/**
|
|
52
|
+
* Properties of returned file from File System API.
|
|
53
|
+
*/
|
|
19
54
|
export interface IFile extends IFilePath {
|
|
20
55
|
localUri: string;
|
|
56
|
+
/**
|
|
57
|
+
* Image thumbnail URI of the file, which can be used to display a preview of the file.
|
|
58
|
+
* Note: Supported only on Linux.
|
|
59
|
+
*/
|
|
21
60
|
imageThumbnailUriTemplate?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Video thumbnail URI of the file, which can be used to display a preview of the file.
|
|
63
|
+
* Note: Supported only on Linux.
|
|
64
|
+
*/
|
|
22
65
|
videoThumbnailUriTemplate?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Date and time when the file was created in milliseconds since the epoch.
|
|
68
|
+
*/
|
|
23
69
|
createdAt?: number;
|
|
24
70
|
lastModifiedAt?: number;
|
|
25
71
|
sizeBytes?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/FrontApplet/FileSystem/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/FrontApplet/FileSystem/types.ts"],"names":[],"mappings":";;;AA4Ba,QAAA,aAAa,GAAG;IAC5B,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,QAAQ;IAClB,SAAS,EAAE,QAAQ;IACnB,WAAW,EAAE,QAAQ;IACrB,SAAS,EAAE,SAAS;CACpB,CAAC;AAqEW,QAAA,UAAU,GAAG;IACzB,WAAW,EAAE,EAAE,MAAM,EAAE,qBAAa,EAAE;IACtC,QAAQ,EAAE,QAAQ;CAClB,CAAC;AAMW,QAAA,iBAAiB,GAAG;IAChC,SAAS,EAAE,UAAU;CACrB,CAAC;AAMW,QAAA,iBAAiB,GAAG;IAChC,SAAS,EAAE,UAAU;CACrB,CAAC"}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import IPostMessage from '../../IPostMessage';
|
|
2
2
|
import IBarcodeScannerDataMessage from './IBarcodeScannerDataMessage';
|
|
3
|
-
import IBarcodeScanner, { IBarcodeScannerOptions } from './IBarcodeScanner';
|
|
3
|
+
import IBarcodeScanner, { IBarcodeScannerOptions, IBarcodeScannerResponse } from './IBarcodeScanner';
|
|
4
4
|
export declare const DEFAULT_SCANNER_ID = 0;
|
|
5
|
+
/**
|
|
6
|
+
* The `sos.hardware.barcodeScanner` API provides methods for working with barcode scanners.
|
|
7
|
+
* It allows starting and stopping the scanner, as well as listening for scanned data and errors.
|
|
8
|
+
*
|
|
9
|
+
* :::note
|
|
10
|
+
* This API is experimental and may change in the future.
|
|
11
|
+
* :::
|
|
12
|
+
*/
|
|
5
13
|
export default class BarcodeScanner implements IBarcodeScanner {
|
|
6
14
|
private messagePrefix;
|
|
7
15
|
private postMessage;
|
|
@@ -10,17 +18,37 @@ export default class BarcodeScanner implements IBarcodeScanner {
|
|
|
10
18
|
/** @internal */
|
|
11
19
|
constructor(messagePrefix: string, postMessage: IPostMessage<any>);
|
|
12
20
|
/**
|
|
13
|
-
*
|
|
21
|
+
* The `getVersion()` method returns the version of the barcode scanner.
|
|
22
|
+
*
|
|
23
|
+
* @returns {Promise<string>} Returns a promise that resolves to the version of the barcode scanner.
|
|
24
|
+
* @throws {Error} If the version cannot be retrieved.
|
|
25
|
+
* @since 3.0.0
|
|
14
26
|
*/
|
|
15
27
|
getVersion(): Promise<string>;
|
|
16
28
|
/**
|
|
17
|
-
*
|
|
29
|
+
* The `start()` starts the barcode scanner and starts listening for scanned data.
|
|
30
|
+
* @param userOptions User options to configure the scanner.
|
|
31
|
+
* @param userOptions.timeout The maximum time to wait for a scan before timing out.
|
|
32
|
+
* @param userOptions.cancelPrevious If set to `true`, it will cancel any previous scanner instance with the same `scannerId`.
|
|
33
|
+
* @returns Returns a promise that resolves to an object with methods to stop the scanner and listen for scanned data and errors.
|
|
34
|
+
* @throws {Error} If the scanner cannot be started.
|
|
35
|
+
* @throws {Error} If the scanner is already running and `cancelPrevious` option is not set to `true`.
|
|
36
|
+
* @throws {Error} If any other error occurs while starting the scanner.
|
|
37
|
+
* @since 3.0.0
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // Start the barcode scanner with default options
|
|
41
|
+
* const scanner = await sos.hardware.barcodeScanner.start();
|
|
42
|
+
* // Listen for scanned data
|
|
43
|
+
* scanner.onData((data) => {
|
|
44
|
+
* console.log(`Scanned data: ${data}`);
|
|
45
|
+
* });
|
|
46
|
+
* // Listen for errors
|
|
47
|
+
* scanner.onError((error) => {
|
|
48
|
+
* console.error(`Scanner error: ${error.message}`);
|
|
49
|
+
* });
|
|
18
50
|
*/
|
|
19
|
-
start(userOptions?: Omit<IBarcodeScannerOptions, 'scannerId'>): Promise<
|
|
20
|
-
stop: () => Promise<void>;
|
|
21
|
-
onData: (listener: (data: string) => void) => void;
|
|
22
|
-
onError: (listener: (error: Error) => void) => void;
|
|
23
|
-
}>;
|
|
51
|
+
start(userOptions?: Omit<IBarcodeScannerOptions, 'scannerId'>): Promise<IBarcodeScannerResponse>;
|
|
24
52
|
/** @internal */
|
|
25
53
|
handleMessageData(msg: IBarcodeScannerDataMessage): void;
|
|
26
54
|
private getMessage;
|
|
@@ -3,6 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DEFAULT_SCANNER_ID = void 0;
|
|
4
4
|
const events_1 = require("events");
|
|
5
5
|
exports.DEFAULT_SCANNER_ID = 0;
|
|
6
|
+
/**
|
|
7
|
+
* The `sos.hardware.barcodeScanner` API provides methods for working with barcode scanners.
|
|
8
|
+
* It allows starting and stopping the scanner, as well as listening for scanned data and errors.
|
|
9
|
+
*
|
|
10
|
+
* :::note
|
|
11
|
+
* This API is experimental and may change in the future.
|
|
12
|
+
* :::
|
|
13
|
+
*/
|
|
6
14
|
class BarcodeScanner {
|
|
7
15
|
messagePrefix;
|
|
8
16
|
postMessage;
|
|
@@ -15,7 +23,11 @@ class BarcodeScanner {
|
|
|
15
23
|
this.eventEmitter = new events_1.EventEmitter();
|
|
16
24
|
}
|
|
17
25
|
/**
|
|
18
|
-
*
|
|
26
|
+
* The `getVersion()` method returns the version of the barcode scanner.
|
|
27
|
+
*
|
|
28
|
+
* @returns {Promise<string>} Returns a promise that resolves to the version of the barcode scanner.
|
|
29
|
+
* @throws {Error} If the version cannot be retrieved.
|
|
30
|
+
* @since 3.0.0
|
|
19
31
|
*/
|
|
20
32
|
async getVersion() {
|
|
21
33
|
const { version } = await this.postMessage({
|
|
@@ -24,7 +36,27 @@ class BarcodeScanner {
|
|
|
24
36
|
return version;
|
|
25
37
|
}
|
|
26
38
|
/**
|
|
27
|
-
*
|
|
39
|
+
* The `start()` starts the barcode scanner and starts listening for scanned data.
|
|
40
|
+
* @param userOptions User options to configure the scanner.
|
|
41
|
+
* @param userOptions.timeout The maximum time to wait for a scan before timing out.
|
|
42
|
+
* @param userOptions.cancelPrevious If set to `true`, it will cancel any previous scanner instance with the same `scannerId`.
|
|
43
|
+
* @returns Returns a promise that resolves to an object with methods to stop the scanner and listen for scanned data and errors.
|
|
44
|
+
* @throws {Error} If the scanner cannot be started.
|
|
45
|
+
* @throws {Error} If the scanner is already running and `cancelPrevious` option is not set to `true`.
|
|
46
|
+
* @throws {Error} If any other error occurs while starting the scanner.
|
|
47
|
+
* @since 3.0.0
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* // Start the barcode scanner with default options
|
|
51
|
+
* const scanner = await sos.hardware.barcodeScanner.start();
|
|
52
|
+
* // Listen for scanned data
|
|
53
|
+
* scanner.onData((data) => {
|
|
54
|
+
* console.log(`Scanned data: ${data}`);
|
|
55
|
+
* });
|
|
56
|
+
* // Listen for errors
|
|
57
|
+
* scanner.onError((error) => {
|
|
58
|
+
* console.error(`Scanner error: ${error.message}`);
|
|
59
|
+
* });
|
|
28
60
|
*/
|
|
29
61
|
async start(userOptions) {
|
|
30
62
|
const defaultOptions = { scannerId: exports.DEFAULT_SCANNER_ID, timeout: 10000, cancelPrevious: false };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarcodeScanner.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAKzB,QAAA,kBAAkB,GAAG,CAAC,CAAC;AAEpC,MAAqB,cAAc;IAOzB;IACA;IAPF,MAAM,CAAC,cAAc,GAAsB,iBAAiB,CAAC;IAE5D,YAAY,CAAe;IAEnC,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;QAEtC,IAAI,CAAC,YAAY,GAAG,IAAI,qBAAY,EAAE,CAAC;IACxC,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"BarcodeScanner.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAKzB,QAAA,kBAAkB,GAAG,CAAC,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAqB,cAAc;IAOzB;IACA;IAPF,MAAM,CAAC,cAAc,GAAsB,iBAAiB,CAAC;IAE5D,YAAY,CAAe;IAEnC,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;QAEtC,IAAI,CAAC,YAAY,GAAG,IAAI,qBAAY,EAAE,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,UAAU;QACtB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YAC1C,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;SACpC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACI,KAAK,CAAC,KAAK,CAAC,WAAuD;QACzE,MAAM,cAAc,GAAG,EAAE,SAAS,EAAE,0BAAkB,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc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AAC,IAAI,EAAE,CAAC;YAClB,KAAK,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;gBAC3B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,GAAG,CAAC,SAAS,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;gBACrE,MAAM;YACP,KAAK,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;gBAC5B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,GAAG,CAAC,SAAS,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;gBACtE,MAAM;YACP,QAAQ;QACT,CAAC;IACF,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5E,CAAC;;AA/FF,iCAgGC"}
|
|
@@ -4,6 +4,11 @@ export interface IBarcodeScannerOptions {
|
|
|
4
4
|
cancelPrevious?: boolean;
|
|
5
5
|
scannerId?: number;
|
|
6
6
|
}
|
|
7
|
+
export interface IBarcodeScannerResponse {
|
|
8
|
+
stop: () => Promise<void>;
|
|
9
|
+
onData: (listener: (data: string) => void) => void;
|
|
10
|
+
onError: (listener: (error: Error) => void) => void;
|
|
11
|
+
}
|
|
7
12
|
export default interface IBarcodeScanner {
|
|
8
13
|
getVersion(): Promise<string>;
|
|
9
14
|
start(userOptions?: Omit<IBarcodeScannerOptions, 'scannerId'>): Promise<{
|
|
@@ -7,7 +7,23 @@ import IBarcodeScannerDataMessage from './BarcodeScanner/IBarcodeScannerDataMess
|
|
|
7
7
|
import IHardware from './IHardware';
|
|
8
8
|
import ISerialPort from './ISerialPort';
|
|
9
9
|
/**
|
|
10
|
-
* The `sos.hardware` API groups together methods for working with hardware. It allows opening
|
|
10
|
+
* The `sos.hardware` API groups together methods for working with hardware. It allows opening serial ports, using bar scanner or controlling LEDs.
|
|
11
|
+
*
|
|
12
|
+
* :::warning
|
|
13
|
+
* - Before using this API, ensure that the display [supports](/sdk/sos/display#supports) serial via `sos.display.supports("SERIAL")`.
|
|
14
|
+
* - Samsung Kiosk serial connection only works over serial ports, not over USB ports.
|
|
15
|
+
* :::
|
|
16
|
+
*
|
|
17
|
+
* ### List of supported serial ports
|
|
18
|
+
* Bellow is example list of serial ports that can be used with `sos.hardware.openSerialPort()` method.
|
|
19
|
+
*
|
|
20
|
+
* | Device type | Default value | Other available values |
|
|
21
|
+
* |:----|:-----|:------|
|
|
22
|
+
* | RaspberryPi / Linux | `/dev/ttyS0` | `/dev/ttyS1`, `/dev/ttyUSB0`, `/dev/ttyUSB1` |
|
|
23
|
+
* | Windows | `COM3` | `COM1`, `COM2`, `COM4` etc. Usually it's always `COM3` |
|
|
24
|
+
* | Samsung Kiosk | `PORT1` | `PORT2`, `PORT3`, `PORT4` |
|
|
25
|
+
* | Android | `/dev/ttyusb0` | `/dev/ttyusb1`, `/dev/ttyusb2` |
|
|
26
|
+
* | BrightSign | `0` | `0` (Serial Jack as `/dev/ttyS0`), `1` (GPIO port as `/dev/ttyS1`), `USB:A/0` (USB-to-serial as `/dev/ttyUSB0`) |
|
|
11
27
|
*/
|
|
12
28
|
export default class Hardware implements IHardware {
|
|
13
29
|
private messagePrefix;
|
|
@@ -15,19 +31,32 @@ export default class Hardware implements IHardware {
|
|
|
15
31
|
static MESSAGE_PREFIX: string;
|
|
16
32
|
readonly led: Led;
|
|
17
33
|
barcodeScanner: BarcodeScanner;
|
|
18
|
-
private eventEmitter;
|
|
34
|
+
private readonly eventEmitter;
|
|
19
35
|
/** @internal */
|
|
20
36
|
constructor(messagePrefix: string, postMessage: IPostMessage<any>);
|
|
21
37
|
/**
|
|
22
|
-
* The `openSerialPort()` method opens a serial port for reading/writing. After the port is opened the method returns ISerialPort interface.
|
|
23
|
-
*
|
|
38
|
+
* The `openSerialPort()` method opens a serial port for reading/writing. After the port is opened the method returns {@link ISerialPort} interface.
|
|
39
|
+
*
|
|
40
|
+
* @param options.device Specifies the address of the external device, check the table above for ports.
|
|
24
41
|
* @param options.baudRate Specifies the data transmission speed in bits per second.
|
|
25
42
|
* @param options.parity Specifies the form of error checking, whether (or what) extra bits are added to a byte.
|
|
26
43
|
* @param options.databits Specifies the number of bits in a byte.
|
|
27
44
|
* @param options.stopbits Specifies the number of bits used to signal the end of a communication packet.
|
|
28
45
|
* @param options.rtscts Enables or disables RTS/CTS handshaking over the serial port. Currently supported by selected models of BrightSign.
|
|
46
|
+
* @returns Returns a promise that resolves to an instance of {@link ISerialPort} interface, which can be used to read/write data from/to the serial port.
|
|
47
|
+
* @throws {Error} If the serial port cannot be opened.
|
|
48
|
+
* @throws {Error} If the device address is not supported by the platform.
|
|
49
|
+
* @throws {Error} If the device fails to process the data.
|
|
50
|
+
* @throws {Error} If any other error occurs while opening the serial port.
|
|
51
|
+
* @since 4.4.0
|
|
29
52
|
*
|
|
30
|
-
* @
|
|
53
|
+
* @example
|
|
54
|
+
* // Open serial port on BrightSign with default settings
|
|
55
|
+
* const serialPort = await sos.hardware.openSerialPort({
|
|
56
|
+
* device: '0',
|
|
57
|
+
* baudRate: 9600,
|
|
58
|
+
* });
|
|
59
|
+
* serialPort.write('68656c6c6f'); // Write "hello" in hexadecimal
|
|
31
60
|
*/
|
|
32
61
|
openSerialPort(options: ISerialPortOptions): Promise<ISerialPort>;
|
|
33
62
|
/** @internal */
|
|
@@ -7,9 +7,24 @@ const events_1 = require("events");
|
|
|
7
7
|
const Led_1 = __importDefault(require("./Led/Led"));
|
|
8
8
|
const SerialPort_1 = __importDefault(require("./SerialPort"));
|
|
9
9
|
const BarcodeScanner_1 = __importDefault(require("./BarcodeScanner/BarcodeScanner"));
|
|
10
|
-
// TODO: add warnings from the old docs
|
|
11
10
|
/**
|
|
12
|
-
* The `sos.hardware` API groups together methods for working with hardware. It allows opening
|
|
11
|
+
* The `sos.hardware` API groups together methods for working with hardware. It allows opening serial ports, using bar scanner or controlling LEDs.
|
|
12
|
+
*
|
|
13
|
+
* :::warning
|
|
14
|
+
* - Before using this API, ensure that the display [supports](/sdk/sos/display#supports) serial via `sos.display.supports("SERIAL")`.
|
|
15
|
+
* - Samsung Kiosk serial connection only works over serial ports, not over USB ports.
|
|
16
|
+
* :::
|
|
17
|
+
*
|
|
18
|
+
* ### List of supported serial ports
|
|
19
|
+
* Bellow is example list of serial ports that can be used with `sos.hardware.openSerialPort()` method.
|
|
20
|
+
*
|
|
21
|
+
* | Device type | Default value | Other available values |
|
|
22
|
+
* |:----|:-----|:------|
|
|
23
|
+
* | RaspberryPi / Linux | `/dev/ttyS0` | `/dev/ttyS1`, `/dev/ttyUSB0`, `/dev/ttyUSB1` |
|
|
24
|
+
* | Windows | `COM3` | `COM1`, `COM2`, `COM4` etc. Usually it's always `COM3` |
|
|
25
|
+
* | Samsung Kiosk | `PORT1` | `PORT2`, `PORT3`, `PORT4` |
|
|
26
|
+
* | Android | `/dev/ttyusb0` | `/dev/ttyusb1`, `/dev/ttyusb2` |
|
|
27
|
+
* | BrightSign | `0` | `0` (Serial Jack as `/dev/ttyS0`), `1` (GPIO port as `/dev/ttyS1`), `USB:A/0` (USB-to-serial as `/dev/ttyUSB0`) |
|
|
13
28
|
*/
|
|
14
29
|
class Hardware {
|
|
15
30
|
messagePrefix;
|
|
@@ -27,15 +42,28 @@ class Hardware {
|
|
|
27
42
|
this.barcodeScanner = new BarcodeScanner_1.default(this.getMessagePrefix(), this.postMessage);
|
|
28
43
|
}
|
|
29
44
|
/**
|
|
30
|
-
* The `openSerialPort()` method opens a serial port for reading/writing. After the port is opened the method returns ISerialPort interface.
|
|
31
|
-
*
|
|
45
|
+
* The `openSerialPort()` method opens a serial port for reading/writing. After the port is opened the method returns {@link ISerialPort} interface.
|
|
46
|
+
*
|
|
47
|
+
* @param options.device Specifies the address of the external device, check the table above for ports.
|
|
32
48
|
* @param options.baudRate Specifies the data transmission speed in bits per second.
|
|
33
49
|
* @param options.parity Specifies the form of error checking, whether (or what) extra bits are added to a byte.
|
|
34
50
|
* @param options.databits Specifies the number of bits in a byte.
|
|
35
51
|
* @param options.stopbits Specifies the number of bits used to signal the end of a communication packet.
|
|
36
52
|
* @param options.rtscts Enables or disables RTS/CTS handshaking over the serial port. Currently supported by selected models of BrightSign.
|
|
53
|
+
* @returns Returns a promise that resolves to an instance of {@link ISerialPort} interface, which can be used to read/write data from/to the serial port.
|
|
54
|
+
* @throws {Error} If the serial port cannot be opened.
|
|
55
|
+
* @throws {Error} If the device address is not supported by the platform.
|
|
56
|
+
* @throws {Error} If the device fails to process the data.
|
|
57
|
+
* @throws {Error} If any other error occurs while opening the serial port.
|
|
58
|
+
* @since 4.4.0
|
|
37
59
|
*
|
|
38
|
-
* @
|
|
60
|
+
* @example
|
|
61
|
+
* // Open serial port on BrightSign with default settings
|
|
62
|
+
* const serialPort = await sos.hardware.openSerialPort({
|
|
63
|
+
* device: '0',
|
|
64
|
+
* baudRate: 9600,
|
|
65
|
+
* });
|
|
66
|
+
* serialPort.write('68656c6c6f'); // Write "hello" in hexadecimal
|
|
39
67
|
*/
|
|
40
68
|
async openSerialPort(options) {
|
|
41
69
|
const { refid } = await this.postMessage({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hardware.js","sourceRoot":"","sources":["../../../src/FrontApplet/Hardware/Hardware.ts"],"names":[],"mappings":";;;;;AAAA,mCAAsC;AAEtC,oDAA4B;AAC5B,8DAAsC;AAGtC,qFAA6D;AAK7D
|
|
1
|
+
{"version":3,"file":"Hardware.js","sourceRoot":"","sources":["../../../src/FrontApplet/Hardware/Hardware.ts"],"names":[],"mappings":";;;;;AAAA,mCAAsC;AAEtC,oDAA4B;AAC5B,8DAAsC;AAGtC,qFAA6D;AAK7D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAqB,QAAQ;IAUnB;IACA;IAVF,MAAM,CAAC,cAAc,GAAW,UAAU,CAAC;IAElC,GAAG,CAAM;IAClB,cAAc,CAAiB;IAErB,YAAY,CA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AC;IAEO,gBAAgB;QACvB,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,QAAQ,CAAC,cAAc,CAAC;IAC3D,CAAC;;AAnEF,2BAoEC"}
|
|
@@ -1,11 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returned by sos.hardware.openSerialPort() method.
|
|
3
|
+
* This interface provides methods to read/write data from/to the serial port.
|
|
4
|
+
*/
|
|
1
5
|
export default interface ISerialPort {
|
|
2
6
|
/**
|
|
3
7
|
* The `onData()` method sets up a listener, which is called whenever new data are received. The listener will stop after the serial port
|
|
4
8
|
* is closed.
|
|
9
|
+
*
|
|
10
|
+
* @param listener A function that will be called with the received data as a Uint8Array.
|
|
11
|
+
* @returns {void} Returns when the listener is set up.
|
|
5
12
|
*/
|
|
6
13
|
onData(listener: (data: Uint8Array) => void): void;
|
|
7
14
|
/**
|
|
8
|
-
* The `write()` method writes data to the serial port. The data can be a string of hexadecimal digits, array of numbers or Uint8Array
|
|
15
|
+
* The `write()` method writes data to the serial port. The data can be a string of hexadecimal digits, array of numbers or Uint8Array.
|
|
16
|
+
*
|
|
17
|
+
* @param data The data to write to the serial port.
|
|
18
|
+
* @returns {Promise<void>} Returns a promise that resolves when the data is successfully written to the serial port.
|
|
19
|
+
* @throws {Error} If the data cannot be written to the serial port.
|
|
20
|
+
* @throws {Error} If the serial port is not open.
|
|
21
|
+
* @throws {Error} If any other error occurs while writing to the serial port.
|
|
9
22
|
*
|
|
10
23
|
* @example
|
|
11
24
|
* // serial port instance previously created via sos.hardware.openSerialPort()
|
|
@@ -16,6 +29,9 @@ export default interface ISerialPort {
|
|
|
16
29
|
write(data: string | number[] | Uint8Array): Promise<void>;
|
|
17
30
|
/**
|
|
18
31
|
* The `close()` method closes the serial port.
|
|
32
|
+
*
|
|
33
|
+
* @returns {Promise<void>} Returns a promise that resolves when the serial port is successfully closed.
|
|
34
|
+
* @throws {Error} If the serial port cannot be closed.
|
|
19
35
|
*/
|
|
20
36
|
close(): Promise<void>;
|
|
21
37
|
}
|
|
@@ -5,6 +5,12 @@ export declare enum Parity {
|
|
|
5
5
|
ODD = "odd",
|
|
6
6
|
SPACE = "space"
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Options for opening a serial port used by the `sos.hardware.openSerialPort()` method.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* All properties are optional except `baudRate`.
|
|
13
|
+
*/
|
|
8
14
|
interface ISerialPortOptions {
|
|
9
15
|
device?: string;
|
|
10
16
|
baudRate: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ISerialPortOptions.js","sourceRoot":"","sources":["../../../src/FrontApplet/Hardware/ISerialPortOptions.ts"],"names":[],"mappings":";;;AAAA,IAAY,MAMX;AAND,WAAY,MAAM;IACjB,uBAAa,CAAA;IACb,uBAAa,CAAA;IACb,uBAAa,CAAA;IACb,qBAAW,CAAA;IACX,yBAAe,CAAA;AAChB,CAAC,EANW,MAAM,sBAAN,MAAM,QAMjB"}
|
|
1
|
+
{"version":3,"file":"ISerialPortOptions.js","sourceRoot":"","sources":["../../../src/FrontApplet/Hardware/ISerialPortOptions.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,MAMX;AAND,WAAY,MAAM;IACjB,uBAAa,CAAA;IACb,uBAAa,CAAA;IACb,uBAAa,CAAA;IACb,qBAAW,CAAA;IACX,yBAAe,CAAA;AAChB,CAAC,EANW,MAAM,sBAAN,MAAM,QAMjB"}
|
|
@@ -2,8 +2,11 @@ import IPostMessage from '../../IPostMessage';
|
|
|
2
2
|
import ISetColorMessage from './ISetColorMessage';
|
|
3
3
|
import ILed from './ILed';
|
|
4
4
|
/**
|
|
5
|
-
* The `sos.hardware.led` API groups together methods for controlling LEDs of the device.
|
|
6
|
-
*
|
|
5
|
+
* The `sos.hardware.led` API groups together methods for controlling LEDs of the device.
|
|
6
|
+
*
|
|
7
|
+
* :::warning
|
|
8
|
+
* This is currently only supported by Phillips devices.
|
|
9
|
+
* :::
|
|
7
10
|
*/
|
|
8
11
|
export default class Led implements ILed {
|
|
9
12
|
private messagePrefix;
|
|
@@ -12,7 +15,20 @@ export default class Led implements ILed {
|
|
|
12
15
|
/** @internal */
|
|
13
16
|
constructor(messagePrefix: string, postMessage: IPostMessage<ISetColorMessage>);
|
|
14
17
|
/**
|
|
15
|
-
* The `setColor()` methods sets the LED color
|
|
18
|
+
* The `setColor()` methods sets the LED color.
|
|
19
|
+
*
|
|
20
|
+
* @param color The color to set the LED to, in hexadecimal format (e.g. `#FF0000` for red). If `null`, it will turn off the LED.
|
|
21
|
+
* @returns {Promise<void>} Returns a promise that resolves when the color is successfully set.
|
|
22
|
+
* @throws {Error} If the color is not a valid hexadecimal string or is not a string at all.
|
|
23
|
+
* @throws {Error} If the LED cannot be controlled by the device.
|
|
24
|
+
* @throws {Error} If any other error occurs while setting the color.
|
|
25
|
+
* @since 4.4.0
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Set the LED color to red
|
|
29
|
+
* await sos.hardware.led.setColor('#FF0000');
|
|
30
|
+
* // Turn off the LED
|
|
31
|
+
* await sos.hardware.led.setColor(null);
|
|
16
32
|
*/
|
|
17
33
|
setColor(color: string | null): Promise<void>;
|
|
18
34
|
private checkColorValidity;
|
|
@@ -6,8 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const ErrorCodes_1 = __importDefault(require("../../Error/ErrorCodes"));
|
|
7
7
|
const Validate_1 = __importDefault(require("../../Validate/Validate"));
|
|
8
8
|
/**
|
|
9
|
-
* The `sos.hardware.led` API groups together methods for controlling LEDs of the device.
|
|
10
|
-
*
|
|
9
|
+
* The `sos.hardware.led` API groups together methods for controlling LEDs of the device.
|
|
10
|
+
*
|
|
11
|
+
* :::warning
|
|
12
|
+
* This is currently only supported by Phillips devices.
|
|
13
|
+
* :::
|
|
11
14
|
*/
|
|
12
15
|
class Led {
|
|
13
16
|
messagePrefix;
|
|
@@ -19,7 +22,20 @@ class Led {
|
|
|
19
22
|
this.postMessage = postMessage;
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
|
-
* The `setColor()` methods sets the LED color
|
|
25
|
+
* The `setColor()` methods sets the LED color.
|
|
26
|
+
*
|
|
27
|
+
* @param color The color to set the LED to, in hexadecimal format (e.g. `#FF0000` for red). If `null`, it will turn off the LED.
|
|
28
|
+
* @returns {Promise<void>} Returns a promise that resolves when the color is successfully set.
|
|
29
|
+
* @throws {Error} If the color is not a valid hexadecimal string or is not a string at all.
|
|
30
|
+
* @throws {Error} If the LED cannot be controlled by the device.
|
|
31
|
+
* @throws {Error} If any other error occurs while setting the color.
|
|
32
|
+
* @since 4.4.0
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Set the LED color to red
|
|
36
|
+
* await sos.hardware.led.setColor('#FF0000');
|
|
37
|
+
* // Turn off the LED
|
|
38
|
+
* await sos.hardware.led.setColor(null);
|
|
23
39
|
*/
|
|
24
40
|
async setColor(color) {
|
|
25
41
|
this.checkColorValidity(color);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Led.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Hardware/Led/Led.ts"],"names":[],"mappings":";;;;;AAEA,wEAAgD;AAChD,uEAA+C;AAG/C
|
|
1
|
+
{"version":3,"file":"Led.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Hardware/Led/Led.ts"],"names":[],"mappings":";;;;;AAEA,wEAAgD;AAChD,uEAA+C;AAG/C;;;;;;GAMG;AACH,MAAqB,GAAG;IAKd;IACA;IALF,MAAM,CAAC,cAAc,GAAW,KAAK,CAAC;IAE7C,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA2C;QAD3C,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAgC;IACjD,CAAC;IAEJ;;;;;;;;;;;;;;;OAeG;IACI,KAAK,CAAC,QAAQ,CAAC,KAAoB;QACzC,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;YAClC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI;SACzC,CAAC,CAAC;IACJ,CAAC;IAEO,kBAAkB,CAAC,KAAoB;QAC9C,IAAA,kBAAQ,EAAC,EAAE,KAAK,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,oBAAU,CAAC,gCAAgC,CAAC,CAAC;QAC1F,IAAA,kBAAQ,EAAC,EAAE,KAAK,EAAE,CAAC;aACjB,SAAS,EAAE;aACX,WAAW,CAAC,qBAAqB,EAAE,oBAAU,CAAC,+BAA+B,CAAC,CAAC;IAClF,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,GAAG,CAAC,cAAc,GAAG,GAAG,GAAG,IAAI,CAAC;IACnE,CAAC;;AA1CF,sBA2CC"}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KeyUp event interface for handling key release events.
|
|
3
|
+
*/
|
|
1
4
|
interface IKeyUpEvent {
|
|
2
5
|
type: 'keyup';
|
|
3
6
|
keyCode: KeyUpEventMap;
|
|
4
7
|
keyName: keyof typeof KeyUpEventMap;
|
|
5
8
|
}
|
|
6
9
|
export default IKeyUpEvent;
|
|
10
|
+
/**
|
|
11
|
+
* Enum of supported key codes for KeyUp events.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* If a key is not listed here, it will show warning in the console.
|
|
15
|
+
*/
|
|
7
16
|
export declare enum KeyUpEventMap {
|
|
8
17
|
UNKNOWN = 0,
|
|
9
18
|
NUM_0 = 1,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.KeyUpEventMap = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Enum of supported key codes for KeyUp events.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* If a key is not listed here, it will show warning in the console.
|
|
9
|
+
*/
|
|
4
10
|
var KeyUpEventMap;
|
|
5
11
|
(function (KeyUpEventMap) {
|
|
6
12
|
KeyUpEventMap[KeyUpEventMap["UNKNOWN"] = 0] = "UNKNOWN";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IKeyUpEvent.js","sourceRoot":"","sources":["../../../src/FrontApplet/Input/IKeyUpEvent.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"IKeyUpEvent.js","sourceRoot":"","sources":["../../../src/FrontApplet/Input/IKeyUpEvent.ts"],"names":[],"mappings":";;;AAcA;;;;;GAKG;AACH,IAAY,aA6BX;AA7BD,WAAY,aAAa;IACxB,uDAAW,CAAA;IACX,mDAAS,CAAA;IACT,mDAAS,CAAA;IACT,mDAAS,CAAA;IACT,mDAAS,CAAA;IACT,mDAAS,CAAA;IACT,mDAAS,CAAA;IACT,mDAAS,CAAA;IACT,mDAAS,CAAA;IACT,mDAAS,CAAA;IACT,oDAAU,CAAA;IACV,8DAAe,CAAA;IACf,0DAAa,CAAA;IACb,gEAAgB,CAAA;IAChB,8DAAe,CAAA;IACf,sDAAW,CAAA;IACX,kDAAS,CAAA;IACT,gDAAQ,CAAA;IACR,oDAAU,CAAA;IACV,gEAAgB,CAAA;IAChB,4DAAc,CAAA;IACd,oDAAU,CAAA;IACV,4DAAc,CAAA;IACd,kDAAS,CAAA;IACT,kDAAS,CAAA;IACT,sDAAW,CAAA;IACX,4DAAc,CAAA;IACd,kDAAS,CAAA;AACV,CAAC,EA7BW,aAAa,6BAAb,aAAa,QA6BxB"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import IInputKeyMessage from './IInputKeyMessage';
|
|
2
2
|
import IKeyUpEvent from './IKeyUpEvent';
|
|
3
3
|
import IInput from './IInput';
|
|
4
|
+
/**
|
|
5
|
+
* The `sos.input` API groups together all input-related functionality, such as remote control key events. With this API, you can
|
|
6
|
+
* listen to key events from the remote control and handle them in your application.
|
|
7
|
+
*/
|
|
4
8
|
export default class Input implements IInput {
|
|
5
9
|
readonly window: Window;
|
|
6
10
|
private readonly messagePrefix;
|
|
@@ -13,11 +17,19 @@ export default class Input implements IInput {
|
|
|
13
17
|
/** @internal */
|
|
14
18
|
destroy(): void;
|
|
15
19
|
/**
|
|
16
|
-
* The `onKeyUp` method sets up a listeners, which is called on every
|
|
20
|
+
* The `onKeyUp` method sets up a listeners, which is called on every keystroke of the remote controller. For the specific logic of an
|
|
17
21
|
* application (games for example), binding the remote control inputs can be helpful. Only a subset of all remote control keys is
|
|
18
22
|
* supported on the specific device. Only numerical digits are guaranteed to be supported.
|
|
19
23
|
*
|
|
24
|
+
* :::note
|
|
20
25
|
* This feature must be tested by users on real devices.
|
|
26
|
+
* :::
|
|
27
|
+
*
|
|
28
|
+
* @param listener The listener function that will be called on every key up event.
|
|
29
|
+
* @returns {void} Resolves when the listener is successfully set up.
|
|
30
|
+
* @throws {Error} If listener is not valid function.
|
|
31
|
+
* @throws {Error} If listener is unregistered.
|
|
32
|
+
* @since 1.3.0
|
|
21
33
|
*/
|
|
22
34
|
onKeyUp(listener: (event: IKeyUpEvent) => void): void;
|
|
23
35
|
/** @internal */
|
|
@@ -28,6 +40,10 @@ export default class Input implements IInput {
|
|
|
28
40
|
removeEventListeners(): void;
|
|
29
41
|
/**
|
|
30
42
|
* The `removeEventListener()` method removes all event listeners for a specific event (only `keyup` is supported).
|
|
43
|
+
*
|
|
44
|
+
* @param event The name of the event to remove the listener for. Currently, only `keyup` is supported.
|
|
45
|
+
* @param listener The listener function to remove.
|
|
46
|
+
* @returns {void} Resolves when the listener is successfully removed.
|
|
31
47
|
*/
|
|
32
48
|
removeEventListener(event: 'keyup', listener: (...args: any[]) => void): void;
|
|
33
49
|
/** @internal */
|