@signageos/front-applet 8.1.3 → 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.
Files changed (79) hide show
  1. package/dist/bundle.js.map +1 -1
  2. package/docs/sos/browser.md +17 -17
  3. package/docs/sos/command.md +6 -6
  4. package/docs/sos/debug.md +7 -3
  5. package/docs/sos/deviceInfo.md +6 -2
  6. package/docs/sos/display.md +3 -3
  7. package/docs/sos/fileSystem.md +67 -67
  8. package/docs/sos/hardware/barcodeScanner.md +58 -15
  9. package/docs/sos/hardware/index.md +72 -15
  10. package/docs/sos/hardware/led.md +32 -3
  11. package/docs/sos/index.md +3 -3
  12. package/docs/sos/input.md +7 -7
  13. package/docs/sos/monitors.md +8 -0
  14. package/docs/sos/native/mdc.md +9 -9
  15. package/docs/sos/offline/cache.md +368 -28
  16. package/docs/sos/offline/index.md +127 -24
  17. package/docs/sos/osd.md +8 -1
  18. package/docs/sos/proofOfPlay.md +28 -0
  19. package/docs/sos/stream.md +78 -78
  20. package/docs/sos/sync.md +228 -21
  21. package/docs/sos/video.md +73 -73
  22. package/docs/sos_management/app.md +11 -11
  23. package/docs/sos_management/audio.md +3 -3
  24. package/docs/sos_management/firmware.md +11 -11
  25. package/docs/sos_management/index.md +9 -9
  26. package/docs/sos_management/network.md +10 -10
  27. package/docs/sos_management/package.md +6 -6
  28. package/docs/sos_management/power.md +27 -27
  29. package/docs/sos_management/screen.md +17 -17
  30. package/docs/sos_management/security.md +3 -3
  31. package/docs/sos_management/time.md +8 -8
  32. package/docs/sos_management/wifi.md +12 -12
  33. package/es6/FrontApplet/Debug/Debug.d.ts +1 -1
  34. package/es6/FrontApplet/Debug/Debug.js +1 -1
  35. package/es6/FrontApplet/DeviceInfo/DeviceInfo.d.ts +6 -2
  36. package/es6/FrontApplet/DeviceInfo/DeviceInfo.js +6 -2
  37. package/es6/FrontApplet/DeviceInfo/DeviceInfo.js.map +1 -1
  38. package/es6/FrontApplet/Display/Display.d.ts +1 -1
  39. package/es6/FrontApplet/Display/Display.js +1 -1
  40. package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.d.ts +36 -8
  41. package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js +34 -2
  42. package/es6/FrontApplet/Hardware/BarcodeScanner/BarcodeScanner.js.map +1 -1
  43. package/es6/FrontApplet/Hardware/BarcodeScanner/IBarcodeScanner.d.ts +5 -0
  44. package/es6/FrontApplet/Hardware/Hardware.d.ts +34 -5
  45. package/es6/FrontApplet/Hardware/Hardware.js +33 -5
  46. package/es6/FrontApplet/Hardware/Hardware.js.map +1 -1
  47. package/es6/FrontApplet/Hardware/ISerialPort.d.ts +17 -1
  48. package/es6/FrontApplet/Hardware/ISerialPortDataMessage.d.ts +3 -0
  49. package/es6/FrontApplet/Hardware/ISerialPortOptions.d.ts +6 -0
  50. package/es6/FrontApplet/Hardware/ISerialPortOptions.js +3 -0
  51. package/es6/FrontApplet/Hardware/ISerialPortOptions.js.map +1 -1
  52. package/es6/FrontApplet/Hardware/Led/Led.d.ts +19 -3
  53. package/es6/FrontApplet/Hardware/Led/Led.js +19 -3
  54. package/es6/FrontApplet/Hardware/Led/Led.js.map +1 -1
  55. package/es6/FrontApplet/Monitors/Monitors.d.ts +5 -0
  56. package/es6/FrontApplet/Monitors/Monitors.js +5 -0
  57. package/es6/FrontApplet/Monitors/Monitors.js.map +1 -1
  58. package/es6/FrontApplet/NativeCommands/MDC/INativeMdcCommands.d.ts +1 -0
  59. package/es6/FrontApplet/OSD/OSD.d.ts +5 -1
  60. package/es6/FrontApplet/OSD/OSD.js +5 -1
  61. package/es6/FrontApplet/OSD/OSD.js.map +1 -1
  62. package/es6/FrontApplet/Offline/Cache/Cache.d.ts +205 -28
  63. package/es6/FrontApplet/Offline/Cache/Cache.js +205 -28
  64. package/es6/FrontApplet/Offline/Cache/Cache.js.map +1 -1
  65. package/es6/FrontApplet/Offline/IAddFont.js.map +1 -1
  66. package/es6/FrontApplet/Offline/IFileType.js.map +1 -1
  67. package/es6/FrontApplet/Offline/ISaveFile.d.ts +3 -0
  68. package/es6/FrontApplet/Offline/ISaveFile.js.map +1 -1
  69. package/es6/FrontApplet/Offline/Offline.d.ts +58 -15
  70. package/es6/FrontApplet/Offline/Offline.js +56 -13
  71. package/es6/FrontApplet/Offline/Offline.js.map +1 -1
  72. package/es6/FrontApplet/ProofOfPlay/IRecordItemOptions.d.ts +3 -0
  73. package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.d.ts +15 -1
  74. package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js +15 -1
  75. package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js.map +1 -1
  76. package/es6/FrontApplet/Sync/Sync.d.ts +101 -18
  77. package/es6/FrontApplet/Sync/Sync.js +84 -10
  78. package/es6/FrontApplet/Sync/Sync.js.map +1 -1
  79. package/package.json +1 -1
@@ -81,9 +81,9 @@ type Event<TType extends EventType = EventType> = {
81
81
 
82
82
  #### Params
83
83
 
84
- | Name | Type | Description |
85
- |------------|-------------------------------|-------------------------------------------------------|
86
- | `listener` | `(event: CloseEvent) => void` | The listener to be called when the browser is closed. |
84
+ | Name | Type | Required | Description |
85
+ |------------|-------------------------------|------------------|-------------------------------------------------------|
86
+ | `listener` | `(event: CloseEvent) => void` | <div>Yes</div> | The listener to be called when the browser is closed. |
87
87
 
88
88
  #### Return value
89
89
 
@@ -159,20 +159,20 @@ type ITheme = {
159
159
 
160
160
  #### Params
161
161
 
162
- | Name | Type | Description |
163
- |-------------------------------------------|------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
164
- | `uri` | `string` | The URL to open in the browser. |
165
- | `options` *(optional)* | `IOpenLinkOptions` | Optional parameters to configure the browser window. |
166
- | `options.aclDomains` *(optional)* | `string[]` | List of domains to be interpreted according to `aclMode`. Example: `signageos.io`, `www.example.com` |
167
- | `options.aclMode` *(optional)* | `"blacklist" \| "whitelist"` | `blacklist` – Allow access to all domains except those in aclDomains and their subdomains, `whitelist` – Allow access only to domains in aclDomains and their subdomains. |
168
- | `options.readOnlyAddressBar` *(optional)* | `boolean` | If `true`, the address bar is read-only, if `false` the user can navigate away by entering a URL in the address bar. |
169
- | `options.idleTimeout` *(optional)* | `number` | The browser will automatically close after a specified period of inactivity (in milliseconds). |
170
- | `options.coordinates` *(optional)* | `{ x: number; y: number; width: number; height: number; }` | Size and position of the browser window. Defaults to fullscreen. |
171
- | `options.theme` *(optional)* | `ITheme` | Specify custom UI theme. (Android only) |
172
- | `options.headlessMode` *(optional)* | `boolean` | Headless mode hides the entire address bar. (Android only) |
173
- | `options.canUserClose` *(optional)* | `boolean` | Whether the user can manually close the browser. (default if headless false, else true) |
174
- | `options.clearData` *(optional)* | `boolean` | Clear cache after the browser closes. (default if headless false, else true) |
175
- | `options.method` *(optional)* | `"native" \| "iframe"` | Can only be native (which opens a new, fully sandboxed fullscreen window) or iframe (which opens a configurable-sized window). (only Linux) |
162
+ | Name | Type | Required | Description |
163
+ |------------------------------|------------------------------------------------------------|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
164
+ | `uri` | `string` | <div>Yes</div> | The URL to open in the browser. |
165
+ | `options` | `IOpenLinkOptions` | <div>No</div> | Optional parameters to configure the browser window. |
166
+ | `options.aclDomains` | `string[]` | <div>No</div> | List of domains to be interpreted according to `aclMode`. Example: `signageos.io`, `www.example.com` |
167
+ | `options.aclMode` | `"blacklist" \| "whitelist"` | <div>No</div> | `blacklist` – Allow access to all domains except those in aclDomains and their subdomains, `whitelist` – Allow access only to domains in aclDomains and their subdomains. |
168
+ | `options.readOnlyAddressBar` | `boolean` | <div>No</div> | If `true`, the address bar is read-only, if `false` the user can navigate away by entering a URL in the address bar. |
169
+ | `options.idleTimeout` | `number` | <div>No</div> | The browser will automatically close after a specified period of inactivity (in milliseconds). |
170
+ | `options.coordinates` | `{ x: number; y: number; width: number; height: number; }` | <div>No</div> | Size and position of the browser window. Defaults to fullscreen. |
171
+ | `options.theme` | `ITheme` | <div>No</div> | Specify custom UI theme. (Android only) |
172
+ | `options.headlessMode` | `boolean` | <div>No</div> | Headless mode hides the entire address bar. (Android only) |
173
+ | `options.canUserClose` | `boolean` | <div>No</div> | Whether the user can manually close the browser. (default if headless false, else true) |
174
+ | `options.clearData` | `boolean` | <div>No</div> | Clear cache after the browser closes. (default if headless false, else true) |
175
+ | `options.method` | `"native" \| "iframe"` | <div>No</div> | Can only be native (which opens a new, fully sandboxed fullscreen window) or iframe (which opens a configurable-sized window). (only Linux) |
176
176
 
177
177
  #### Return value
178
178
 
@@ -38,9 +38,9 @@ interface ICommand {
38
38
 
39
39
  #### Params
40
40
 
41
- | Name | Type | Description |
42
- |-----------|------------|-------------------------------|
43
- | `command` | `TCommand` | The command to be dispatched. |
41
+ | Name | Type | Required | Description |
42
+ |-----------|------------|------------------|-------------------------------|
43
+ | `command` | `TCommand` | <div>Yes</div> | The command to be dispatched. |
44
44
 
45
45
  #### Possible errors
46
46
 
@@ -103,9 +103,9 @@ interface ICommand {
103
103
 
104
104
  #### Params
105
105
 
106
- | Name | Type | Description |
107
- |------------|------------------------------------|-----------------------------------------------------------|
108
- | `listener` | `(command: ICommandEvent) => void` | The listener to be called when a new command is received. |
106
+ | Name | Type | Required | Description |
107
+ |------------|------------------------------------|------------------|-----------------------------------------------------------|
108
+ | `listener` | `(command: ICommandEvent) => void` | <div>Yes</div> | The listener to be called when a new command is received. |
109
109
 
110
110
  #### Return value
111
111
 
package/docs/sos/debug.md CHANGED
@@ -21,6 +21,10 @@ The `isRemoteDebugEnabled()` method returns the state of the Device debug mode.
21
21
  isRemoteDebugEnabled(): Promise<boolean>;
22
22
  ```
23
23
 
24
+ #### Return value
25
+
26
+ Resolves to `true` if the remote debug mode is enabled, otherwise `false`.
27
+
24
28
  <Separator />
25
29
 
26
30
  ### onRemoteDebugChanged()
@@ -35,9 +39,9 @@ onRemoteDebugChanged(listener: (data: {
35
39
 
36
40
  #### Params
37
41
 
38
- | Name | Type | Description |
39
- |------------|-----------------------------------------|-------------------------------------------------------------------------------|
40
- | `listener` | `(data: { enabled: boolean; }) => void` | The listener to be called when the state of the remote debug mode is changed. |
42
+ | Name | Type | Required | Description |
43
+ |------------|-----------------------------------------|------------------|-------------------------------------------------------------------------------|
44
+ | `listener` | `(data: { enabled: boolean; }) => void` | <div>Yes</div> | The listener to be called when the state of the remote debug mode is changed. |
41
45
 
42
46
  #### Return value
43
47
 
@@ -14,6 +14,10 @@ tags.
14
14
  The `getDeviceName()` method returns a name of the device. Name is requested from server on application start, automatically
15
15
  updated when changed and persisted in local storage.
16
16
 
17
+ :::note
18
+ Device name can be set only in CloudControl on Device Info page, or via [Rest API](https://developers.signageos.io/api/#tag/Device/paths/~1v2~1device~1%7BdeviceUid%7D/get).
19
+ :::
20
+
17
21
  ```ts expandable
18
22
  getDeviceName(): Promise<string>;
19
23
  ```
@@ -37,7 +41,7 @@ The `getLocation()` method returns location of the device. Location is requested
37
41
  updated when changed and persisted in local storage.
38
42
 
39
43
  :::note
40
- Location can be set only in CloudControl on Device Info page, or via Rest API.
44
+ Location can be set only in CloudControl on Device Info page, or via [Rest API](https://developers.signageos.io/api/#tag/DeviceLocation/paths/~1v1~1device~1%7BdeviceUid%7D~1location~1%7BlocationUid%7D/get).
41
45
  :::
42
46
 
43
47
  ```ts expandable
@@ -63,7 +67,7 @@ The `getOrganizationTags()` method returns all tags assigned to the device. Tags
63
67
  updated when changed and persisted in local storage.
64
68
 
65
69
  :::note
66
- Tags can be set only in CloudControl on Device Info page, or via Rest API.
70
+ Tags can be set only in CloudControl on Device Info page, or via [Rest API](https://developers.signageos.io/api/#tag/DeviceTag-(Device-Tags)).
67
71
  :::
68
72
 
69
73
  ```ts expandable
@@ -47,9 +47,9 @@ type AnyString = string & {};
47
47
 
48
48
  #### Params
49
49
 
50
- | Name | Type | Description |
51
- |--------------|---------------------|----------------------------------------|
52
- | `capability` | `DisplayCapability` | - The capability to check for support. |
50
+ | Name | Type | Required | Description |
51
+ |--------------|---------------------|------------------|--------------------------------------|
52
+ | `capability` | `DisplayCapability` | <div>Yes</div> | The capability to check for support. |
53
53
 
54
54
  #### Return value
55
55
 
@@ -96,10 +96,10 @@ interface IStorageUnit {
96
96
 
97
97
  #### Params
98
98
 
99
- | Name | Type | Description |
100
- |------------|-------------|-----------------------------------------|
101
- | `filePath` | `IFilePath` | The path to the file to be appended. |
102
- | `contents` | `string` | The content to be appended to the file. |
99
+ | Name | Type | Required | Description |
100
+ |------------|-------------|------------------|-----------------------------------------|
101
+ | `filePath` | `IFilePath` | <div>Yes</div> | The path to the file to be appended. |
102
+ | `contents` | `string` | <div>Yes</div> | The content to be appended to the file. |
103
103
 
104
104
  #### Return value
105
105
 
@@ -182,12 +182,12 @@ interface ICopyFileOptions {
182
182
 
183
183
  #### Params
184
184
 
185
- | Name | Type | Description |
186
- |----------------------------------|--------------------|----------------------------------------------------------------------------------------|
187
- | `sourceFilePath` | `IFilePath` | The path to the file to be copied. |
188
- | `destinationFilePath` | `IFilePath` | The path where the file will be copied to. |
189
- | `options` *(optional)* | `ICopyFileOptions` | Options for copying the file. |
190
- | `options.overwrite` *(optional)* | `boolean` | If set to `true`, the method will overwrite the destination file if it already exists. |
185
+ | Name | Type | Required | Description |
186
+ |-----------------------|--------------------|------------------|----------------------------------------------------------------------------------------|
187
+ | `sourceFilePath` | `IFilePath` | <div>Yes</div> | The path to the file to be copied. |
188
+ | `destinationFilePath` | `IFilePath` | <div>Yes</div> | The path where the file will be copied to. |
189
+ | `options` | `ICopyFileOptions` | <div>No</div> | Options for copying the file. |
190
+ | `options.overwrite` | `boolean` | <div>No</div> | If set to `true`, the method will overwrite the destination file if it already exists. |
191
191
 
192
192
  #### Return value
193
193
 
@@ -281,10 +281,10 @@ interface IStorageUnit {
281
281
 
282
282
  #### Params
283
283
 
284
- | Name | Type | Description |
285
- |-------------------|---------------|-------------------------------------------------------|
286
- | `archiveFilePath` | `IFilePath` | The path where the archive file will be created. |
287
- | `archiveEntries` | `IFilePath[]` | An array of file paths to be included in the archive. |
284
+ | Name | Type | Required | Description |
285
+ |-------------------|---------------|------------------|-------------------------------------------------------|
286
+ | `archiveFilePath` | `IFilePath` | <div>Yes</div> | The path where the archive file will be created. |
287
+ | `archiveEntries` | `IFilePath[]` | <div>Yes</div> | An array of file paths to be included in the archive. |
288
288
 
289
289
  #### Return value
290
290
 
@@ -384,9 +384,9 @@ interface IStorageUnit {
384
384
 
385
385
  #### Params
386
386
 
387
- | Name | Type | Description |
388
- |-----------------|-------------|---------------------------------------------------|
389
- | `directoryPath` | `IFilePath` | The path where the new directory will be created. |
387
+ | Name | Type | Required | Description |
388
+ |-----------------|-------------|------------------|---------------------------------------------------|
389
+ | `directoryPath` | `IFilePath` | <div>Yes</div> | The path where the new directory will be created. |
390
390
 
391
391
  #### Return value
392
392
 
@@ -464,10 +464,10 @@ interface IStorageUnit {
464
464
 
465
465
  #### Params
466
466
 
467
- | Name | Type | Description |
468
- |-------------|-------------|------------------------------------------------------------------------------------------|
469
- | `filePath` | `IFilePath` | The path to the file or directory to be deleted. |
470
- | `recursive` | `boolean` | If set to `true`, the method will delete the directory and all its contents recursively. |
467
+ | Name | Type | Required | Description |
468
+ |-------------|-------------|------------------|------------------------------------------------------------------------------------------|
469
+ | `filePath` | `IFilePath` | <div>Yes</div> | The path to the file or directory to be deleted. |
470
+ | `recursive` | `boolean` | <div>Yes</div> | If set to `true`, the method will delete the directory and all its contents recursively. |
471
471
 
472
472
  #### Return value
473
473
 
@@ -591,11 +591,11 @@ interface IHeaders {
591
591
 
592
592
  #### Params
593
593
 
594
- | Name | Type | Description |
595
- |------------------------|-------------|---------------------------------------------------------------------------------------------------------------------------------|
596
- | `filePath` | `IFilePath` | The path where the downloaded file will be saved. |
597
- | `sourceUri` | `string` | The URI of the file to be downloaded. |
598
- | `headers` *(optional)* | `IHeaders` | Key, value pairs of HTTP headers to send along with the request. Used when the target file is protected by a password or if any |
594
+ | Name | Type | Required | Description |
595
+ |-------------|-------------|------------------|---------------------------------------------------------------------------------------------------------------------------------|
596
+ | `filePath` | `IFilePath` | <div>Yes</div> | The path where the downloaded file will be saved. |
597
+ | `sourceUri` | `string` | <div>Yes</div> | The URI of the file to be downloaded. |
598
+ | `headers` | `IHeaders` | <div>No</div> | Key, value pairs of HTTP headers to send along with the request. Used when the target file is protected by a password or if any |
599
599
 
600
600
  #### Return value
601
601
 
@@ -677,9 +677,9 @@ interface IStorageUnit {
677
677
 
678
678
  #### Params
679
679
 
680
- | Name | Type | Description |
681
- |------------|-------------|---------------------------------------------|
682
- | `filePath` | `IFilePath` | The path to the file or directory to check. |
680
+ | Name | Type | Required | Description |
681
+ |------------|-------------|------------------|---------------------------------------------|
682
+ | `filePath` | `IFilePath` | <div>Yes</div> | The path to the file or directory to check. |
683
683
 
684
684
  #### Return value
685
685
 
@@ -768,11 +768,11 @@ type AnyString = string & {};
768
768
 
769
769
  #### Params
770
770
 
771
- | Name | Type | Description |
772
- |----------------------------|---------------------|-----------------------------------------------------------------------|
773
- | `archiveFilePath` | `IFilePath` | The path to the archive file to be decompressed. |
774
- | `destinationDirectoryPath` | `IFilePath` | The path to the directory where the decompressed files will be saved. |
775
- | `method` | `ExtractMethodType` | Extract method to use for extracting, e.g. 'zip'. |
771
+ | Name | Type | Required | Description |
772
+ |----------------------------|---------------------|------------------|-----------------------------------------------------------------------|
773
+ | `archiveFilePath` | `IFilePath` | <div>Yes</div> | The path to the archive file to be decompressed. |
774
+ | `destinationDirectoryPath` | `IFilePath` | <div>Yes</div> | The path to the directory where the decompressed files will be saved. |
775
+ | `method` | `ExtractMethodType` | <div>Yes</div> | Extract method to use for extracting, e.g. 'zip'. |
776
776
 
777
777
  #### Possible errors
778
778
 
@@ -878,9 +878,9 @@ interface IStorageUnit {
878
878
 
879
879
  #### Params
880
880
 
881
- | Name | Type | Description |
882
- |------------|-------------|---------------------------------------|
883
- | `filePath` | `IFilePath` | The path to the file to be retrieved. |
881
+ | Name | Type | Required | Description |
882
+ |------------|-------------|------------------|---------------------------------------|
883
+ | `filePath` | `IFilePath` | <div>Yes</div> | The path to the file to be retrieved. |
884
884
 
885
885
  #### Return value
886
886
 
@@ -972,10 +972,10 @@ type AnyString = string & {};
972
972
 
973
973
  #### Params
974
974
 
975
- | Name | Type | Description |
976
- |------------|-----------------|---------------------------------------------------------------|
977
- | `filePath` | `IFilePath` | The path to the file for which the checksum will be computed. |
978
- | `hashType` | `HashAlgorithm` | The type of hash algorithm to use for computing the checksum. |
975
+ | Name | Type | Required | Description |
976
+ |------------|-----------------|------------------|---------------------------------------------------------------|
977
+ | `filePath` | `IFilePath` | <div>Yes</div> | The path to the file for which the checksum will be computed. |
978
+ | `hashType` | `HashAlgorithm` | <div>Yes</div> | The type of hash algorithm to use for computing the checksum. |
979
979
 
980
980
  #### Return value
981
981
 
@@ -1054,9 +1054,9 @@ interface IStorageUnit {
1054
1054
 
1055
1055
  #### Params
1056
1056
 
1057
- | Name | Type | Description |
1058
- |------------|-------------|-------------------------|
1059
- | `filePath` | `IFilePath` | The file path to check. |
1057
+ | Name | Type | Required | Description |
1058
+ |------------|-------------|------------------|-------------------------|
1059
+ | `filePath` | `IFilePath` | <div>Yes</div> | The file path to check. |
1060
1060
 
1061
1061
  #### Return value
1062
1062
 
@@ -1140,10 +1140,10 @@ interface IStorageUnit {
1140
1140
 
1141
1141
  #### Params
1142
1142
 
1143
- | Name | Type | Description |
1144
- |-----------------------|-------------|----------------------------------------------------------------------|
1145
- | `sourceFilePath` | `IFilePath` | The path to the existing file or directory that you want to link to. |
1146
- | `destinationFilePath` | `IFilePath` | The path where the symbolic link will be created. |
1143
+ | Name | Type | Required | Description |
1144
+ |-----------------------|-------------|------------------|----------------------------------------------------------------------|
1145
+ | `sourceFilePath` | `IFilePath` | <div>Yes</div> | The path to the existing file or directory that you want to link to. |
1146
+ | `destinationFilePath` | `IFilePath` | <div>Yes</div> | The path where the symbolic link will be created. |
1147
1147
 
1148
1148
  #### Return value
1149
1149
 
@@ -1226,9 +1226,9 @@ interface IStorageUnit {
1226
1226
 
1227
1227
  #### Params
1228
1228
 
1229
- | Name | Type | Description |
1230
- |-----------------|-------------|-------------------------------------------------------|
1231
- | `directoryPath` | `IFilePath` | The path to the directory where files will be listed. |
1229
+ | Name | Type | Required | Description |
1230
+ |-----------------|-------------|------------------|-------------------------------------------------------|
1231
+ | `directoryPath` | `IFilePath` | <div>Yes</div> | The path to the directory where files will be listed. |
1232
1232
 
1233
1233
  #### Return value
1234
1234
 
@@ -1434,12 +1434,12 @@ interface IMoveFileOptions {
1434
1434
 
1435
1435
  #### Params
1436
1436
 
1437
- | Name | Type | Description |
1438
- |----------------------------------|--------------------|----------------------------------------------------------------------------------------|
1439
- | `sourceFilePath` | `IFilePath` | The path to the file to be moved. |
1440
- | `destinationFilePath` | `IFilePath` | The path where the file will be moved to. |
1441
- | `options` *(optional)* | `IMoveFileOptions` | Options for moving the file. |
1442
- | `options.overwrite` *(optional)* | `boolean` | If set to `true`, the method will overwrite the destination file if it already exists. |
1437
+ | Name | Type | Required | Description |
1438
+ |-----------------------|--------------------|------------------|----------------------------------------------------------------------------------------|
1439
+ | `sourceFilePath` | `IFilePath` | <div>Yes</div> | The path to the file to be moved. |
1440
+ | `destinationFilePath` | `IFilePath` | <div>Yes</div> | The path where the file will be moved to. |
1441
+ | `options` | `IMoveFileOptions` | <div>No</div> | Options for moving the file. |
1442
+ | `options.overwrite` | `boolean` | <div>No</div> | If set to `true`, the method will overwrite the destination file if it already exists. |
1443
1443
 
1444
1444
  #### Return value
1445
1445
 
@@ -1482,9 +1482,9 @@ onStorageUnitsChanged(listener: () => void): void;
1482
1482
 
1483
1483
  #### Params
1484
1484
 
1485
- | Name | Type | Description |
1486
- |------------|--------------|-------------------------------------------------------------------|
1487
- | `listener` | `() => void` | The listener function to be called when the storage units change. |
1485
+ | Name | Type | Required | Description |
1486
+ |------------|--------------|------------------|-------------------------------------------------------------------|
1487
+ | `listener` | `() => void` | <div>Yes</div> | The listener function to be called when the storage units change. |
1488
1488
 
1489
1489
  #### Possible errors
1490
1490
 
@@ -1544,9 +1544,9 @@ interface IStorageUnit {
1544
1544
 
1545
1545
  #### Params
1546
1546
 
1547
- | Name | Type | Description |
1548
- |------------|-------------|----------------------------------|
1549
- | `filePath` | `IFilePath` | The path to the file to be read. |
1547
+ | Name | Type | Required | Description |
1548
+ |------------|-------------|------------------|----------------------------------|
1549
+ | `filePath` | `IFilePath` | <div>Yes</div> | The path to the file to be read. |
1550
1550
 
1551
1551
  #### Return value
1552
1552
 
@@ -1664,10 +1664,10 @@ interface IStorageUnit {
1664
1664
 
1665
1665
  #### Params
1666
1666
 
1667
- | Name | Type | Description |
1668
- |------------|-------------|----------------------------------------|
1669
- | `filePath` | `IFilePath` | The path to the file to be written. |
1670
- | `contents` | `string` | The content to be written to the file. |
1667
+ | Name | Type | Required | Description |
1668
+ |------------|-------------|------------------|----------------------------------------|
1669
+ | `filePath` | `IFilePath` | <div>Yes</div> | The path to the file to be written. |
1670
+ | `contents` | `string` | <div>Yes</div> | The content to be written to the file. |
1671
1671
 
1672
1672
  #### Return value
1673
1673
 
@@ -4,36 +4,39 @@ sidebar_position: 0
4
4
 
5
5
  # barcodeScanner
6
6
 
7
- ## Methods
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.
8
9
 
9
- ### getVersion()
10
+ :::note
11
+ This API is experimental and may change in the future.
12
+ :::
10
13
 
11
- :::warning
14
+ ## Methods
12
15
 
13
- This API is experimental and may change in the future.
16
+ ### getVersion()
14
17
 
15
- :::
18
+ The `getVersion()` method returns the version of the barcode scanner.
16
19
 
17
20
  ```ts expandable
18
21
  getVersion(): Promise<string>;
19
22
  ```
20
23
 
21
- <Separator />
24
+ #### Return value
22
25
 
23
- ### start()
26
+ Returns a promise that resolves to the version of the barcode scanner.
24
27
 
25
- :::warning
28
+ #### Possible errors
26
29
 
27
- This API is experimental and may change in the future.
30
+ If the version cannot be retrieved.
28
31
 
29
- :::
32
+ <Separator />
33
+
34
+ ### start()
35
+
36
+ The `start()` starts the barcode scanner and starts listening for scanned data.
30
37
 
31
38
  ```ts expandable
32
- start(userOptions?: Omit<IBarcodeScannerOptions, 'scannerId'>): Promise<{
33
- stop: () => Promise<void>;
34
- onData: (listener: (data: string) => void) => void;
35
- onError: (listener: (error: Error) => void) => void;
36
- }>;
39
+ start(userOptions?: Omit<IBarcodeScannerOptions, 'scannerId'>): Promise<IBarcodeScannerResponse>;
37
40
  // show-more
38
41
  interface IBarcodeScannerOptions {
39
42
  timeout?: number;
@@ -41,4 +44,44 @@ interface IBarcodeScannerOptions {
41
44
  scannerId?: number;
42
45
  }
43
46
 
47
+ interface IBarcodeScannerResponse {
48
+ stop: () => Promise<void>;
49
+ onData: (listener: (data: string) => void) => void;
50
+ onError: (listener: (error: Error) => void) => void;
51
+ }
52
+
53
+ ```
54
+
55
+ #### Params
56
+
57
+ | Name | Type | Required | Description |
58
+ |------------------------------|---------------------------------------------|-----------------|-------------------------------------------------------------------------------------------|
59
+ | `userOptions` | `Omit<IBarcodeScannerOptions, "scannerId">` | <div>No</div> | User options to configure the scanner. |
60
+ | `userOptions.timeout` | `number` | <div>No</div> | The maximum time to wait for a scan before timing out. |
61
+ | `userOptions.cancelPrevious` | `boolean` | <div>No</div> | If set to `true`, it will cancel any previous scanner instance with the same `scannerId`. |
62
+
63
+ #### Return value
64
+
65
+ Returns a promise that resolves to an object with methods to stop the scanner and listen for scanned data and errors.
66
+
67
+ #### Possible errors
68
+
69
+
70
+ - If the scanner cannot be started.
71
+ - If the scanner is already running and `cancelPrevious` option is not set to `true`.
72
+ - If any other error occurs while starting the scanner.
73
+
74
+ #### Example
75
+
76
+ ```ts
77
+ // Start the barcode scanner with default options
78
+ const scanner = await sos.hardware.barcodeScanner.start();
79
+ // Listen for scanned data
80
+ scanner.onData((data) => {
81
+ console.log(`Scanned data: ${data}`);
82
+ });
83
+ // Listen for errors
84
+ scanner.onError((error) => {
85
+ console.error(`Scanner error: ${error.message}`);
86
+ });
44
87
  ```
@@ -4,21 +4,39 @@ sidebar_position: 0
4
4
 
5
5
  # hardware
6
6
 
7
- The `sos.hardware` API groups together methods for working with hardware. It allows opening serials ports, using bar scanner or controlling LEDs.
7
+ The `sos.hardware` API groups together methods for working with hardware. It allows opening serial ports, using bar scanner or controlling LEDs.
8
+
9
+ :::warning
10
+ - Before using this API, ensure that the display [supports](/sdk/sos/display#supports) serial via `sos.display.supports("SERIAL")`.
11
+ - Samsung Kiosk serial connection only works over serial ports, not over USB ports.
12
+ :::
13
+
14
+ ### List of supported serial ports
15
+ Bellow is example list of serial ports that can be used with `sos.hardware.openSerialPort()` method.
16
+
17
+ | Device type | Default value | Other available values |
18
+ |:----|:-----|:------|
19
+ | RaspberryPi / Linux | `/dev/ttyS0` | `/dev/ttyS1`, `/dev/ttyUSB0`, `/dev/ttyUSB1` |
20
+ | Windows | `COM3` | `COM1`, `COM2`, `COM4` etc. Usually it's always `COM3` |
21
+ | Samsung Kiosk | `PORT1` | `PORT2`, `PORT3`, `PORT4` |
22
+ | Android | `/dev/ttyusb0` | `/dev/ttyusb1`, `/dev/ttyusb2` |
23
+ | BrightSign | `0` | `0` (Serial Jack as `/dev/ttyS0`), `1` (GPIO port as `/dev/ttyS1`), `USB:A/0` (USB-to-serial as `/dev/ttyUSB0`) |
8
24
 
9
25
  ## Methods
10
26
 
11
27
  ### openSerialPort()
12
28
 
13
- <Admonition type="info" icon="" title="">
14
- Learn more about using this API [here](https://developers.signageos.io/docs/applets/api-guides/serial-port)
15
- </Admonition>
16
-
17
- The `openSerialPort()` method opens a serial port for reading/writing. After the port is opened the method returns ISerialPort interface.
29
+ The `openSerialPort()` method opens a serial port for reading/writing. After the port is opened the method returns
18
30
 
19
31
  ```ts expandable
20
32
  openSerialPort(options: ISerialPortOptions): Promise<ISerialPort>;
21
33
  // show-more
34
+ /**
35
+ * Options for opening a serial port used by the `sos.hardware.openSerialPort()` method.
36
+ *
37
+ * @remarks
38
+ * All properties are optional except `baudRate`.
39
+ */
22
40
  interface ISerialPortOptions {
23
41
  device?: string;
24
42
  baudRate: number;
@@ -36,14 +54,27 @@ enum Parity {
36
54
  SPACE = "space"
37
55
  }
38
56
 
57
+ /**
58
+ * Returned by sos.hardware.openSerialPort() method.
59
+ * This interface provides methods to read/write data from/to the serial port.
60
+ */
39
61
  interface ISerialPort {
40
62
  /**
41
63
  * The `onData()` method sets up a listener, which is called whenever new data are received. The listener will stop after the serial port
42
64
  * is closed.
65
+ *
66
+ * @param listener A function that will be called with the received data as a Uint8Array.
67
+ * @returns {void} Returns when the listener is set up.
43
68
  */
44
69
  onData(listener: (data: Uint8Array) => void): void;
45
70
  /**
46
- * The `write()` method writes data to the serial port. The data can be a string of hexadecimal digits, array of numbers or Uint8Array
71
+ * The `write()` method writes data to the serial port. The data can be a string of hexadecimal digits, array of numbers or Uint8Array.
72
+ *
73
+ * @param data The data to write to the serial port.
74
+ * @returns {Promise<void>} Returns a promise that resolves when the data is successfully written to the serial port.
75
+ * @throws {Error} If the data cannot be written to the serial port.
76
+ * @throws {Error} If the serial port is not open.
77
+ * @throws {Error} If any other error occurs while writing to the serial port.
47
78
  *
48
79
  * @example
49
80
  * // serial port instance previously created via sos.hardware.openSerialPort()
@@ -54,6 +85,9 @@ interface ISerialPort {
54
85
  write(data: string | number[] | Uint8Array): Promise<void>;
55
86
  /**
56
87
  * The `close()` method closes the serial port.
88
+ *
89
+ * @returns {Promise<void>} Returns a promise that resolves when the serial port is successfully closed.
90
+ * @throws {Error} If the serial port cannot be closed.
57
91
  */
58
92
  close(): Promise<void>;
59
93
  }
@@ -62,14 +96,37 @@ interface ISerialPort {
62
96
 
63
97
  #### Params
64
98
 
65
- | Name | Type | Description |
66
- |---------------------------------|-----------|---------------------------------------------------------------------------------------------------------------------|
67
- | `options.device` *(optional)* | `string` | Specifies the address of the external device. |
68
- | `options.baudRate` | `number` | Specifies the data transmission speed in bits per second. |
69
- | `options.parity` *(optional)* | `Parity` | Specifies the form of error checking, whether (or what) extra bits are added to a byte. |
70
- | `options.databits` *(optional)* | `number` | Specifies the number of bits in a byte. |
71
- | `options.stopbits` *(optional)* | `number` | Specifies the number of bits used to signal the end of a communication packet. |
72
- | `options.rtscts` *(optional)* | `boolean` | Enables or disables RTS/CTS handshaking over the serial port. Currently supported by selected models of BrightSign. |
99
+ | Name | Type | Required | Description |
100
+ |--------------------|-----------|------------------|---------------------------------------------------------------------------------------------------------------------|
101
+ | `options.device` | `string` | <div>No</div> | Specifies the address of the external device, check the table above for ports. |
102
+ | `options.baudRate` | `number` | <div>Yes</div> | Specifies the data transmission speed in bits per second. |
103
+ | `options.parity` | `Parity` | <div>No</div> | Specifies the form of error checking, whether (or what) extra bits are added to a byte. |
104
+ | `options.databits` | `number` | <div>No</div> | Specifies the number of bits in a byte. |
105
+ | `options.stopbits` | `number` | <div>No</div> | Specifies the number of bits used to signal the end of a communication packet. |
106
+ | `options.rtscts` | `boolean` | <div>No</div> | Enables or disables RTS/CTS handshaking over the serial port. Currently supported by selected models of BrightSign. |
107
+
108
+ #### Return value
109
+
110
+ Returns a promise that resolves to an instance of
111
+
112
+ #### Possible errors
113
+
114
+
115
+ - If the serial port cannot be opened.
116
+ - If the device address is not supported by the platform.
117
+ - If the device fails to process the data.
118
+ - If any other error occurs while opening the serial port.
119
+
120
+ #### Example
121
+
122
+ ```ts
123
+ // Open serial port on BrightSign with default settings
124
+ const serialPort = await sos.hardware.openSerialPort({
125
+ device: '0',
126
+ baudRate: 9600,
127
+ });
128
+ serialPort.write('68656c6c6f'); // Write "hello" in hexadecimal
129
+ ```
73
130
 
74
131
  ## API Example
75
132