@signageos/front-applet 8.6.0 → 8.7.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/bundle.js +7 -7
- package/dist/bundle.js.map +1 -1
- package/docs/fpath/index.md +0 -270
- package/docs/sos/browser.md +0 -14
- package/docs/sos/command.md +0 -18
- package/docs/sos/deviceInfo.md +0 -17
- package/docs/sos/display.md +0 -8
- package/docs/sos/fileSystem.md +0 -488
- package/docs/sos/hardware/index.md +2 -49
- package/docs/sos/input.md +0 -12
- package/docs/sos/native/mdc.md +1 -35
- package/docs/sos/native/nmc.md +127 -0
- package/docs/sos/offline/cache.md +0 -6
- package/docs/sos/offline/index.md +0 -27
- package/docs/sos/proofOfPlay.md +0 -10
- package/docs/sos/stream.md +11 -781
- package/docs/sos/sync.md +0 -23
- package/docs/sos/video.md +0 -86
- package/docs/sos_management/app.md +32 -29
- package/docs/sos_management/index.md +0 -8
- package/docs/sos_management/network.md +0 -19
- package/docs/sos_management/os.md +0 -11
- package/docs/sos_management/power.md +50 -30
- package/docs/sos_management/screen.md +0 -7
- package/docs/sos_management/time.md +0 -3
- package/docs/sos_management/wifi.md +0 -101
- package/es6/FrontApplet/Management/App/App.d.ts +34 -24
- package/es6/FrontApplet/Management/App/App.js.map +1 -1
- package/es6/FrontApplet/Management/Power/IPower.d.ts +32 -10
- package/es6/FrontApplet/Management/Power/IPower.js +3 -0
- package/es6/FrontApplet/Management/Power/IPower.js.map +1 -1
- package/es6/FrontApplet/Management/Power/Power.d.ts +12 -8
- package/es6/FrontApplet/Management/Power/Power.js +23 -32
- package/es6/FrontApplet/Management/Power/Power.js.map +1 -1
- package/es6/FrontApplet/Management/Power/PowerHelper.d.ts +8 -3
- package/es6/FrontApplet/Management/Power/PowerHelper.js +32 -0
- package/es6/FrontApplet/Management/Power/PowerHelper.js.map +1 -1
- package/es6/FrontApplet/Management/helpers/ProprietaryTimerHelper.d.ts +2 -1
- package/es6/FrontApplet/Management/helpers/TimerHelper.d.ts +3 -1
- package/es6/FrontApplet/Management/helpers/TimerHelper.js +2 -0
- package/es6/FrontApplet/Management/helpers/TimerHelper.js.map +1 -1
- package/es6/FrontApplet/NativeCommands/NMC/CommandsNmc.d.ts +4 -0
- package/es6/FrontApplet/NativeCommands/NMC/CommandsNmc.js +66 -0
- package/es6/FrontApplet/NativeCommands/NMC/CommandsNmc.js.map +1 -0
- package/es6/FrontApplet/NativeCommands/NMC/INativeNmcCommands.d.ts +21 -0
- package/es6/FrontApplet/NativeCommands/NMC/INativeNmcCommands.js +3 -0
- package/es6/FrontApplet/NativeCommands/NMC/INativeNmcCommands.js.map +1 -0
- package/es6/FrontApplet/NativeCommands/NMC/Nmc.d.ts +50 -0
- package/es6/FrontApplet/NativeCommands/NMC/Nmc.js +77 -0
- package/es6/FrontApplet/NativeCommands/NMC/Nmc.js.map +1 -0
- package/es6/FrontApplet/NativeCommands/NativeCommands.d.ts +2 -0
- package/es6/FrontApplet/NativeCommands/NativeCommands.js +3 -0
- package/es6/FrontApplet/NativeCommands/NativeCommands.js.map +1 -1
- package/es6/FrontApplet/Video/IOptions.d.ts +5 -0
- package/es6/Monitoring/Management/Power/powerCommands.d.ts +3 -3
- package/package.json +1 -1
|
@@ -50,67 +50,43 @@ Make sure that you have a backup script or a checking mechanism in place, which
|
|
|
50
50
|
```ts expandable
|
|
51
51
|
connect(ssid: string, password?: string, options?: IWifiConnectOptions): Promise<void>;
|
|
52
52
|
// show-more
|
|
53
|
-
/**
|
|
54
|
-
* Options for connecting to a Wi-Fi network.
|
|
55
|
-
*/
|
|
56
53
|
interface IWifiConnectOptions<T extends IEAPConfig = IEAPConfig> {
|
|
57
|
-
/** The type of security/encryption used by the network. */
|
|
58
54
|
securityType?: WifiEncryptionType;
|
|
59
|
-
/** Whether the network is hidden. */
|
|
60
55
|
hidden?: boolean;
|
|
61
|
-
/** Authentication details for networks that require EAP. */
|
|
62
56
|
eap?: T;
|
|
63
57
|
}
|
|
64
58
|
|
|
65
59
|
type IEAPConfig = IEAP_PEAP | IEAP_TTLS | IEAP_TLS;
|
|
66
60
|
|
|
67
61
|
interface IEAP_PEAP extends IEAPBase {
|
|
68
|
-
/** The type of EAP authentication to use. */
|
|
69
62
|
method: 'PEAP';
|
|
70
|
-
/** Anonymous/outer identity used for initial authentication before the encrypted tunnel is established. */
|
|
71
63
|
anonymousIdentity?: string;
|
|
72
|
-
/** Secondary authentication method.*/
|
|
73
64
|
phase2Auth?: EAPPhase2Auth;
|
|
74
|
-
/** Whether to use a CA certificate for authentication. */
|
|
75
65
|
useCACert: boolean;
|
|
76
|
-
/** CA certificate in PEM format */
|
|
77
66
|
caCertificate?: string;
|
|
78
67
|
}
|
|
79
68
|
|
|
80
69
|
type EAPPhase2Auth = 'PAP' | 'MSCHAP' | 'MSCHAPV2' | 'GTC' | 'CHAP';
|
|
81
70
|
|
|
82
71
|
interface IEAPBase {
|
|
83
|
-
/** Username or identity for authentication. */
|
|
84
72
|
identity: string;
|
|
85
|
-
/** Password or passphrase for authentication. */
|
|
86
73
|
identityPassword?: string;
|
|
87
|
-
/** Optional domain for server certificate validation. */
|
|
88
74
|
domain?: string;
|
|
89
75
|
}
|
|
90
76
|
|
|
91
77
|
interface IEAP_TTLS extends IEAPBase {
|
|
92
|
-
/** The type of EAP authentication to use. */
|
|
93
78
|
method: 'TTLS';
|
|
94
|
-
/** Anonymous/outer identity used for initial authentication before the encrypted tunnel is established. */
|
|
95
79
|
anonymousIdentity?: string;
|
|
96
|
-
/** Secondary authentication method. */
|
|
97
80
|
phase2Auth?: EAPPhase2Auth;
|
|
98
|
-
/** Whether to use a CA certificate for authentication. */
|
|
99
81
|
useCACert: boolean;
|
|
100
|
-
/** CA certificate in PEM format */
|
|
101
82
|
caCertificate?: string;
|
|
102
83
|
}
|
|
103
84
|
|
|
104
85
|
interface IEAP_TLS extends IEAPBase {
|
|
105
|
-
/** The type of EAP authentication to use. */
|
|
106
86
|
method: 'TLS';
|
|
107
|
-
/** CA certificate in PEM format, if required. */
|
|
108
87
|
caCertificate: string;
|
|
109
|
-
/** Client certificate in PEM format, if required. */
|
|
110
88
|
clientCertificate: string;
|
|
111
|
-
/** Private key in PEM format, if required. */
|
|
112
89
|
privateKey: string;
|
|
113
|
-
/** Password for the private key, if it's encrypted. */
|
|
114
90
|
privateKeyPassword?: string;
|
|
115
91
|
}
|
|
116
92
|
|
|
@@ -406,29 +382,11 @@ The `on()` method sets up a listener, which is called whenever the specified eve
|
|
|
406
382
|
on(event: WifiEvent, listener: () => void): void;
|
|
407
383
|
// show-more
|
|
408
384
|
enum WifiEvent {
|
|
409
|
-
/**
|
|
410
|
-
* Wi-Fi was set to CLIENT state.
|
|
411
|
-
*/
|
|
412
385
|
CLIENT_ENABLED = "client_enabled",
|
|
413
|
-
/**
|
|
414
|
-
* Wi-Fi is in CLIENT state and have connected to a network.
|
|
415
|
-
*/
|
|
416
386
|
CLIENT_CONNECTED = "client_connected",
|
|
417
|
-
/**
|
|
418
|
-
* Wi-Fi is in CLIENT state and failed to connect to a network.
|
|
419
|
-
*/
|
|
420
387
|
CLIENT_CONNECT_REJECTED = "client_connect_rejected",
|
|
421
|
-
/**
|
|
422
|
-
* Wi-Fi is in CLIENT state and disconnected from a network.
|
|
423
|
-
*/
|
|
424
388
|
CLIENT_DISCONNECTED = "client_disconnected",
|
|
425
|
-
/**
|
|
426
|
-
* Wi-Fi was set to AP state.
|
|
427
|
-
*/
|
|
428
389
|
AP_ENABLED = "ap_enabled",
|
|
429
|
-
/**
|
|
430
|
-
* Wi-Fi was set to DISABLED state.
|
|
431
|
-
*/
|
|
432
390
|
DISABLED = "disabled"
|
|
433
391
|
}
|
|
434
392
|
|
|
@@ -463,29 +421,11 @@ The `on()` method sets up a **one-time** listener, which is called whenever the
|
|
|
463
421
|
once(event: WifiEvent, listener: () => void): void;
|
|
464
422
|
// show-more
|
|
465
423
|
enum WifiEvent {
|
|
466
|
-
/**
|
|
467
|
-
* Wi-Fi was set to CLIENT state.
|
|
468
|
-
*/
|
|
469
424
|
CLIENT_ENABLED = "client_enabled",
|
|
470
|
-
/**
|
|
471
|
-
* Wi-Fi is in CLIENT state and have connected to a network.
|
|
472
|
-
*/
|
|
473
425
|
CLIENT_CONNECTED = "client_connected",
|
|
474
|
-
/**
|
|
475
|
-
* Wi-Fi is in CLIENT state and failed to connect to a network.
|
|
476
|
-
*/
|
|
477
426
|
CLIENT_CONNECT_REJECTED = "client_connect_rejected",
|
|
478
|
-
/**
|
|
479
|
-
* Wi-Fi is in CLIENT state and disconnected from a network.
|
|
480
|
-
*/
|
|
481
427
|
CLIENT_DISCONNECTED = "client_disconnected",
|
|
482
|
-
/**
|
|
483
|
-
* Wi-Fi was set to AP state.
|
|
484
|
-
*/
|
|
485
428
|
AP_ENABLED = "ap_enabled",
|
|
486
|
-
/**
|
|
487
|
-
* Wi-Fi was set to DISABLED state.
|
|
488
|
-
*/
|
|
489
429
|
DISABLED = "disabled"
|
|
490
430
|
}
|
|
491
431
|
|
|
@@ -520,29 +460,11 @@ The `removeAllListeners()` method removes all listeners for a specified event or
|
|
|
520
460
|
removeAllListeners(event?: WifiEvent): void;
|
|
521
461
|
// show-more
|
|
522
462
|
enum WifiEvent {
|
|
523
|
-
/**
|
|
524
|
-
* Wi-Fi was set to CLIENT state.
|
|
525
|
-
*/
|
|
526
463
|
CLIENT_ENABLED = "client_enabled",
|
|
527
|
-
/**
|
|
528
|
-
* Wi-Fi is in CLIENT state and have connected to a network.
|
|
529
|
-
*/
|
|
530
464
|
CLIENT_CONNECTED = "client_connected",
|
|
531
|
-
/**
|
|
532
|
-
* Wi-Fi is in CLIENT state and failed to connect to a network.
|
|
533
|
-
*/
|
|
534
465
|
CLIENT_CONNECT_REJECTED = "client_connect_rejected",
|
|
535
|
-
/**
|
|
536
|
-
* Wi-Fi is in CLIENT state and disconnected from a network.
|
|
537
|
-
*/
|
|
538
466
|
CLIENT_DISCONNECTED = "client_disconnected",
|
|
539
|
-
/**
|
|
540
|
-
* Wi-Fi was set to AP state.
|
|
541
|
-
*/
|
|
542
467
|
AP_ENABLED = "ap_enabled",
|
|
543
|
-
/**
|
|
544
|
-
* Wi-Fi was set to DISABLED state.
|
|
545
|
-
*/
|
|
546
468
|
DISABLED = "disabled"
|
|
547
469
|
}
|
|
548
470
|
|
|
@@ -568,29 +490,11 @@ The `removeListener()` method removes a listener previously set up by `on()` or
|
|
|
568
490
|
removeListener(event: WifiEvent, listener: () => void): void;
|
|
569
491
|
// show-more
|
|
570
492
|
enum WifiEvent {
|
|
571
|
-
/**
|
|
572
|
-
* Wi-Fi was set to CLIENT state.
|
|
573
|
-
*/
|
|
574
493
|
CLIENT_ENABLED = "client_enabled",
|
|
575
|
-
/**
|
|
576
|
-
* Wi-Fi is in CLIENT state and have connected to a network.
|
|
577
|
-
*/
|
|
578
494
|
CLIENT_CONNECTED = "client_connected",
|
|
579
|
-
/**
|
|
580
|
-
* Wi-Fi is in CLIENT state and failed to connect to a network.
|
|
581
|
-
*/
|
|
582
495
|
CLIENT_CONNECT_REJECTED = "client_connect_rejected",
|
|
583
|
-
/**
|
|
584
|
-
* Wi-Fi is in CLIENT state and disconnected from a network.
|
|
585
|
-
*/
|
|
586
496
|
CLIENT_DISCONNECTED = "client_disconnected",
|
|
587
|
-
/**
|
|
588
|
-
* Wi-Fi was set to AP state.
|
|
589
|
-
*/
|
|
590
497
|
AP_ENABLED = "ap_enabled",
|
|
591
|
-
/**
|
|
592
|
-
* Wi-Fi was set to DISABLED state.
|
|
593
|
-
*/
|
|
594
498
|
DISABLED = "disabled"
|
|
595
499
|
}
|
|
596
500
|
|
|
@@ -616,13 +520,8 @@ The `scanDevices()` method initializes a new network scan and available networks
|
|
|
616
520
|
```ts expandable
|
|
617
521
|
scanDevices(): Promise<IScannedDevice[]>;
|
|
618
522
|
// show-more
|
|
619
|
-
/**
|
|
620
|
-
* Interface representing a scanned Wi-Fi device.
|
|
621
|
-
*/
|
|
622
523
|
interface IScannedDevice {
|
|
623
|
-
/** SSID of the Wi-Fi network */
|
|
624
524
|
ssid: string;
|
|
625
|
-
/** If Wi-Fi SSID is encrypted */
|
|
626
525
|
encrypted: boolean;
|
|
627
526
|
}
|
|
628
527
|
|
|
@@ -73,24 +73,36 @@ export default class App implements IApp {
|
|
|
73
73
|
*/
|
|
74
74
|
upgrade(baseUrl: string, version: string): Promise<void>;
|
|
75
75
|
/**
|
|
76
|
-
* The `upgrade(appUri)` method upgrades the signageOS application with the provided `appUri`. Open users can upgrade the app passing
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* - ChromeOS: Not supported
|
|
88
|
-
*
|
|
89
|
-
* :::tip
|
|
90
|
-
* Check our latest versions in our [changelogs](https://docs.signageos.io/hc/en-us/sections/4409161443730-Core-Apps).
|
|
76
|
+
* The `upgrade(appUri)` method upgrades the signageOS application with the provided `appUri`. Open users can upgrade the app passing
|
|
77
|
+
* a URL where the application files are hosted.
|
|
78
|
+
*
|
|
79
|
+
* :::warning Strict URL and folder structure requirements
|
|
80
|
+
* The `appUri` **must** follow the exact folder structure produced by the signageOS Device-app Builder.
|
|
81
|
+
* The upgrade will fail silently (device reverts to the previous version) if the URL does not match the expected format.
|
|
82
|
+
*
|
|
83
|
+
* Key rules:
|
|
84
|
+
* 1. **The folder structure on your server must match the ZIP package from signageOS exactly.** Do not rename files or reorganize folders.
|
|
85
|
+
* 2. **HTTP redirects (e.g., 302) are not supported.** Files must be directly accessible at the expected URLs.
|
|
86
|
+
* 3. **The URL must not end with a trailing slash (`/`).** A trailing slash causes the upgrade to fail.
|
|
91
87
|
* :::
|
|
92
88
|
*
|
|
93
|
-
*
|
|
89
|
+
* The expected URL format differs per platform:
|
|
90
|
+
*
|
|
91
|
+
* | Platform | URL format |
|
|
92
|
+
* |----------|-----------|
|
|
93
|
+
* | **Tizen** | Point to the **folder** containing `sssp_config.xml` and `*.wgt` — not to a specific file. E.g. `https://cdn.example.com/app/tizen/2.10.1/landscape` |
|
|
94
|
+
* | **SSSP** | Point to the **folder** containing `sssp_config.xml` and `*.wgt`. E.g. `https://cdn.example.com/app/sssp/2.10.1/landscape_full-hd` |
|
|
95
|
+
* | **webOS 1, 2** | Point to the **ZIP file** directly. E.g. `https://cdn.example.com/app/webos/2.10.1/ApplicationName.zip` |
|
|
96
|
+
* | **webOS 3+** | Point to the **IPK file** directly. E.g. `https://cdn.example.com/app/webos/2.10.1/ApplicationName.ipk` |
|
|
97
|
+
* | **BrightSign** | Point to the **zip file** directly. E.g. `https://cdn.example.com/app/brightsign/2.10.1/display-brightsign.zip` |
|
|
98
|
+
* | **Android** | Point to the **APK file** directly. E.g. `https://cdn.example.com/app/android/2.10.1/io.signageos.android.apk` |
|
|
99
|
+
* | **Windows** | Point to the **zip file** directly. E.g. `https://cdn.example.com/app/windows/2.10.1/windows_2.10.1.zip` |
|
|
100
|
+
* | **ChromeOS** | Not supported |
|
|
101
|
+
*
|
|
102
|
+
* For the full folder structure reference and deployment guide, see
|
|
103
|
+
* [Build & Deploy Your Applet Via Core App with built-in Applet](https://docs.signageos.io/devspace/general-topics/deployment/build-deploy-your-applet-via-core-app-with-built-in-applet).
|
|
104
|
+
*
|
|
105
|
+
* @param appUri URL where the application files are hosted. Must follow the platform-specific format described above.
|
|
94
106
|
* @returns {Promise<void>} A promise that resolves when the upgrade starts.
|
|
95
107
|
* @throws {Error} If the upgrade fails.
|
|
96
108
|
* @since 4.0.0
|
|
@@ -98,14 +110,12 @@ export default class App implements IApp {
|
|
|
98
110
|
* @example // {@link https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/app-upgrade | How to upgrade application via applets}
|
|
99
111
|
*
|
|
100
112
|
* @example
|
|
101
|
-
* // Upgrade
|
|
102
|
-
* await sos.management.app.upgrade('
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* console.error('Failed to start application upgrade:', error);
|
|
108
|
-
* });
|
|
113
|
+
* // Upgrade Tizen device — point to the FOLDER, not a specific file. No trailing slash.
|
|
114
|
+
* await sos.management.app.upgrade('https://cdn.your-cms.com/app/tizen/2.10.1/landscape');
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* // Upgrade BrightSign device — point to the zip file directly
|
|
118
|
+
* await sos.management.app.upgrade('https://cdn.your-cms.com/app/brightsign/2.10.1/display-brightsign.zip');
|
|
109
119
|
*/
|
|
110
120
|
upgrade(appUri: string): Promise<void>;
|
|
111
121
|
private getMessage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/App/App.ts"],"names":[],"mappings":";;AACA,4DAAiE;AAGjE;;;;;;;;;;;GAWG;AACH,MAAqB,GAAG;IAGd;IACA;IAHT,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;IACpC,CAAC;IAEJ;;;;;;;;;;;;;;OAcG;IACI,KAAK,CAAC,OAAO;QACnB,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YAClD,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC;SAC7C,CAAC,CAAC;QAEH,OAAO,eAAe,CAAC;IACxB,CAAC;IAED;;;;;;;;;OASG;IACI,KAAK,CAAC,UAAU;QACtB,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YACrD,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC;SAChD,CAAC,CAAC;QAEH,OAAO,kBAAkB,CAAC;IAC3B,CAAC;
|
|
1
|
+
{"version":3,"file":"App.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/App/App.ts"],"names":[],"mappings":";;AACA,4DAAiE;AAGjE;;;;;;;;;;;GAWG;AACH,MAAqB,GAAG;IAGd;IACA;IAHT,gBAAgB;IAChB,YACS,aAAqB,EACrB,WAA8B;QAD9B,kBAAa,GAAb,aAAa,CAAQ;QACrB,gBAAW,GAAX,WAAW,CAAmB;IACpC,CAAC;IAEJ;;;;;;;;;;;;;;OAcG;IACI,KAAK,CAAC,OAAO;QACnB,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YAClD,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC;SAC7C,CAAC,CAAC;QAEH,OAAO,eAAe,CAAC;IACxB,CAAC;IAED;;;;;;;;;OASG;IACI,KAAK,CAAC,UAAU;QACtB,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;YACrD,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC;SAChD,CAAC,CAAC;QAEH,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IA+ED,gBAAgB;IACT,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,IAAa;QAC/C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,IAAA,qCAAqB,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC1E,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;YACpC,OAAO;YACP,OAAO;YACP,SAAS;SACT,CAAC,CAAC;IACJ,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,IAAI,CAAC;IACxC,CAAC;CACD;AA3ID,sBA2IC"}
|
|
@@ -1,25 +1,41 @@
|
|
|
1
1
|
import { ITimer, TimerType } from '../helpers/TimerHelper';
|
|
2
2
|
import { IProprietaryTimer, ProprietaryTimerType } from '../helpers/ProprietaryTimerHelper';
|
|
3
|
+
import { AnyString } from '../../../utils/types';
|
|
4
|
+
/** @deprecated Use IScheduledRebootAction instead */
|
|
5
|
+
export type IScheduledRebootActions<TRule extends IScheduledRebootRuleRaw | IScheduledRebootRule> = IScheduledRebootAction<TRule>;
|
|
3
6
|
/**
|
|
4
7
|
* Interface representing the scheduled reboot action.
|
|
5
8
|
*/
|
|
6
|
-
export interface
|
|
9
|
+
export interface IScheduledRebootAction<TRule extends IScheduledRebootRuleRaw | IScheduledRebootRule> {
|
|
7
10
|
/** Random generated ID for the scheduled reboot action */
|
|
8
11
|
id: string;
|
|
9
12
|
/** The rule of the scheduled reboot */
|
|
10
|
-
rule:
|
|
13
|
+
rule: TRule;
|
|
11
14
|
}
|
|
12
|
-
|
|
15
|
+
/** @internal */
|
|
16
|
+
export interface IScheduledRebootRuleRaw {
|
|
13
17
|
/** Weekdays as numbers or strings. Number types are received from server. */
|
|
14
|
-
weekdays:
|
|
18
|
+
weekdays: WeekdayNumberType[];
|
|
15
19
|
/** Time in HH:mm:ss format */
|
|
16
20
|
time: string;
|
|
17
21
|
}
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
export interface IScheduledRebootRule {
|
|
23
|
+
/** @deprecated use shortWeekdays property */
|
|
24
|
+
weekdays: WeekdayType[];
|
|
25
|
+
shortWeekdays: ShortWeekdayType[];
|
|
26
|
+
time: string;
|
|
27
|
+
}
|
|
28
|
+
export type ShortWeekdayType = 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';
|
|
29
|
+
/**
|
|
30
|
+
* Allowed scheduled action weekday types
|
|
31
|
+
* @deprecated Use ShortWeekdayType instead
|
|
32
|
+
*/
|
|
33
|
+
export type WeekdayType = 'SUNDAY' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY';
|
|
20
34
|
/**
|
|
21
35
|
* This enum is necessary to convert between the number representation of the weekday and the string representation.
|
|
22
36
|
* On device and servers values are stored as numbers, but in the JS API, we use strings for better human friendly values.
|
|
37
|
+
*
|
|
38
|
+
* @deprecated Use ShortWeekdayType instead
|
|
23
39
|
*/
|
|
24
40
|
export declare enum WeekdayNumbered {
|
|
25
41
|
SUNDAY = 0,
|
|
@@ -30,6 +46,9 @@ export declare enum WeekdayNumbered {
|
|
|
30
46
|
FRIDAY = 5,
|
|
31
47
|
SATURDAY = 6
|
|
32
48
|
}
|
|
49
|
+
/** @deprecated Use ShortWeekdayType instead */
|
|
50
|
+
export type WeekdayNumberType = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
51
|
+
/** @deprecated Use ShortWeekdayType instead */
|
|
33
52
|
export declare enum WeekdayNamed {
|
|
34
53
|
SUNDAY = "SUNDAY",
|
|
35
54
|
MONDAY = "MONDAY",
|
|
@@ -43,13 +62,16 @@ export default interface IPower {
|
|
|
43
62
|
systemReboot(): Promise<void>;
|
|
44
63
|
appRestart(): Promise<void>;
|
|
45
64
|
getTimers(): Promise<ITimer[]>;
|
|
46
|
-
setTimer(type: keyof typeof TimerType, timeOn: string | null, timeOff: string | null, weekdays:
|
|
65
|
+
setTimer(type: keyof typeof TimerType, timeOn: string | null, timeOff: string | null, weekdays: (ShortWeekdayType | AnyString)[], // TODO: remove AnyString in the next major release
|
|
66
|
+
volume: number): Promise<void>;
|
|
47
67
|
unsetTimer(type: keyof typeof TimerType): Promise<void>;
|
|
48
68
|
getProprietaryTimers(): Promise<IProprietaryTimer[]>;
|
|
49
|
-
setProprietaryTimer(type: ProprietaryTimerType, timeOn: string | null, timeOff: string | null, weekdays:
|
|
69
|
+
setProprietaryTimer(type: ProprietaryTimerType, timeOn: string | null, timeOff: string | null, weekdays: (ShortWeekdayType | AnyString)[], // TODO: remove AnyString in the next major release
|
|
70
|
+
keepAppletRunning?: boolean): Promise<void>;
|
|
50
71
|
unsetProprietaryTimer(type: ProprietaryTimerType): Promise<void>;
|
|
51
|
-
setScheduledReboot(weekdays:
|
|
72
|
+
setScheduledReboot(weekdays: (ShortWeekdayType | AnyString)[], // TODO: remove AnyString in the next major release
|
|
73
|
+
time: string): Promise<void>;
|
|
52
74
|
removeScheduledReboot(id: string): Promise<void>;
|
|
53
|
-
getScheduledReboots(): Promise<
|
|
75
|
+
getScheduledReboots(): Promise<IScheduledRebootAction<IScheduledRebootRule>[]>;
|
|
54
76
|
clearScheduledReboots(): Promise<void>;
|
|
55
77
|
}
|
|
@@ -4,6 +4,8 @@ exports.WeekdayNamed = exports.WeekdayNumbered = void 0;
|
|
|
4
4
|
/**
|
|
5
5
|
* This enum is necessary to convert between the number representation of the weekday and the string representation.
|
|
6
6
|
* On device and servers values are stored as numbers, but in the JS API, we use strings for better human friendly values.
|
|
7
|
+
*
|
|
8
|
+
* @deprecated Use ShortWeekdayType instead
|
|
7
9
|
*/
|
|
8
10
|
var WeekdayNumbered;
|
|
9
11
|
(function (WeekdayNumbered) {
|
|
@@ -15,6 +17,7 @@ var WeekdayNumbered;
|
|
|
15
17
|
WeekdayNumbered[WeekdayNumbered["FRIDAY"] = 5] = "FRIDAY";
|
|
16
18
|
WeekdayNumbered[WeekdayNumbered["SATURDAY"] = 6] = "SATURDAY";
|
|
17
19
|
})(WeekdayNumbered || (exports.WeekdayNumbered = WeekdayNumbered = {}));
|
|
20
|
+
/** @deprecated Use ShortWeekdayType instead */
|
|
18
21
|
var WeekdayNamed;
|
|
19
22
|
(function (WeekdayNamed) {
|
|
20
23
|
WeekdayNamed["SUNDAY"] = "SUNDAY";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IPower.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Power/IPower.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"IPower.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Power/IPower.ts"],"names":[],"mappings":";;;AA6CA;;;;;GAKG;AACH,IAAY,eAQX;AARD,WAAY,eAAe;IAC1B,yDAAU,CAAA;IACV,yDAAU,CAAA;IACV,2DAAW,CAAA;IACX,+DAAa,CAAA;IACb,6DAAY,CAAA;IACZ,yDAAU,CAAA;IACV,6DAAY,CAAA;AACb,CAAC,EARW,eAAe,+BAAf,eAAe,QAQ1B;AAKD,+CAA+C;AAC/C,IAAY,YAQX;AARD,WAAY,YAAY;IACvB,iCAAiB,CAAA;IACjB,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;AACtB,CAAC,EARW,YAAY,4BAAZ,YAAY,QAQvB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { AnyString } from '../../../utils/types';
|
|
1
2
|
import IPostMessage from '../../IPostMessage';
|
|
2
|
-
import { ITimer, TimerType } from '../helpers/TimerHelper';
|
|
3
3
|
import { IProprietaryTimer, ProprietaryTimerType } from '../helpers/ProprietaryTimerHelper';
|
|
4
|
-
import
|
|
4
|
+
import { ITimer, TimerType } from '../helpers/TimerHelper';
|
|
5
|
+
import IPower, { IScheduledRebootAction, IScheduledRebootRule, ShortWeekdayType } from './IPower';
|
|
5
6
|
/**
|
|
6
7
|
* The `sos.management.power` API groups together methods related to the power state of the device. Such as rebooting, shutting down,
|
|
7
8
|
* setting timers.
|
|
@@ -62,7 +63,7 @@ export default class Power implements IPower {
|
|
|
62
63
|
* @param type The type of the timer (`TIMER_1`, ..., `TIMER_7`).
|
|
63
64
|
* @param timeOn The time when the device should turn on.
|
|
64
65
|
* @param timeOff The time when the device should turn off.
|
|
65
|
-
* @param weekdays The days of the week when the timer should be active (`mon`, ..., `sun`).
|
|
66
|
+
* @param {ShortWeekdayType} weekdays The days of the week when the timer should be active (`mon`, ..., `sun`).
|
|
66
67
|
* @param volume The volume level set when the device is turned on.
|
|
67
68
|
* @return {Promise<void>} Resolves when the timer is set.
|
|
68
69
|
* @throws {Error} If the timer type is invalid.
|
|
@@ -79,7 +80,8 @@ export default class Power implements IPower {
|
|
|
79
80
|
* @example
|
|
80
81
|
* await sos.management.power.setTimer("TIMER_1", "08:00:00", "22:00:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], 30);
|
|
81
82
|
*/
|
|
82
|
-
setTimer(type: keyof typeof TimerType, timeOn: string | null, timeOff: string | null, weekdays:
|
|
83
|
+
setTimer(type: keyof typeof TimerType, timeOn: string | null, timeOff: string | null, weekdays: (ShortWeekdayType | AnyString)[], // TODO: remove AnyString in the next major release
|
|
84
|
+
volume: number): Promise<void>;
|
|
83
85
|
/**
|
|
84
86
|
* The `unsetTimer()` method removes the specified native timer.
|
|
85
87
|
*
|
|
@@ -127,7 +129,8 @@ export default class Power implements IPower {
|
|
|
127
129
|
* @example
|
|
128
130
|
* await sos.management.power.setProprietaryTimer("TIMER_2", "08:00:00", "22:00:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], false);
|
|
129
131
|
*/
|
|
130
|
-
setProprietaryTimer(type: ProprietaryTimerType, timeOn: string | null, timeOff: string | null, weekdays:
|
|
132
|
+
setProprietaryTimer(type: ProprietaryTimerType, timeOn: string | null, timeOff: string | null, weekdays: (ShortWeekdayType | AnyString)[], // TODO: remove AnyString in the next major release
|
|
133
|
+
keepAppletRunning?: boolean): Promise<void>;
|
|
131
134
|
/**
|
|
132
135
|
* The `unsetProprietaryTimer()` method removes the specified
|
|
133
136
|
* [proprietary timer](https://docs.signageos.io/hc/en-us/articles/4416384202642-Timers#h_01HCD14GEDP96AZV58NRSN2HNQ).
|
|
@@ -154,13 +157,13 @@ export default class Power implements IPower {
|
|
|
154
157
|
/**
|
|
155
158
|
* Returns all scheduled reboot rules on the device set by the `setScheduledReboot()` method.
|
|
156
159
|
*
|
|
157
|
-
* @returns {Promise<
|
|
160
|
+
* @returns {Promise<IScheduledRebootAction[]>} Resolves with an array of scheduled reboot actions.
|
|
158
161
|
* @since 8.1.0
|
|
159
162
|
*
|
|
160
163
|
* @example
|
|
161
164
|
* await sos.management.power.getScheduledReboots();
|
|
162
165
|
*/
|
|
163
|
-
getScheduledReboots(): Promise<
|
|
166
|
+
getScheduledReboots(): Promise<IScheduledRebootAction<IScheduledRebootRule>[]>;
|
|
164
167
|
/**
|
|
165
168
|
* Removes scheduled reboot rule from the device (if it exists).
|
|
166
169
|
* @param id {string} ID of the rule to be removed.
|
|
@@ -202,6 +205,7 @@ export default class Power implements IPower {
|
|
|
202
205
|
* // Schedule reboot every Monday and Friday at 7:30 PM / 19:30
|
|
203
206
|
* await sos.management.power.setScheduledReboot(["MONDAY", "FRIDAY"], "19:30:00");
|
|
204
207
|
*/
|
|
205
|
-
setScheduledReboot(weekdays:
|
|
208
|
+
setScheduledReboot(weekdays: (ShortWeekdayType | AnyString)[], // TODO: remove AnyString in the next major release
|
|
209
|
+
time: string): Promise<void>;
|
|
206
210
|
private getMessage;
|
|
207
211
|
}
|
|
@@ -3,9 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const TimerHelper_1 = require("../helpers/TimerHelper");
|
|
7
6
|
const Validate_1 = __importDefault(require("../../Validate/Validate"));
|
|
8
|
-
const
|
|
7
|
+
const TimerHelper_1 = require("../helpers/TimerHelper");
|
|
9
8
|
const PowerHelper_1 = require("./PowerHelper");
|
|
10
9
|
/**
|
|
11
10
|
* The `sos.management.power` API groups together methods related to the power state of the device. Such as rebooting, shutting down,
|
|
@@ -83,7 +82,7 @@ class Power {
|
|
|
83
82
|
* @param type The type of the timer (`TIMER_1`, ..., `TIMER_7`).
|
|
84
83
|
* @param timeOn The time when the device should turn on.
|
|
85
84
|
* @param timeOff The time when the device should turn off.
|
|
86
|
-
* @param weekdays The days of the week when the timer should be active (`mon`, ..., `sun`).
|
|
85
|
+
* @param {ShortWeekdayType} weekdays The days of the week when the timer should be active (`mon`, ..., `sun`).
|
|
87
86
|
* @param volume The volume level set when the device is turned on.
|
|
88
87
|
* @return {Promise<void>} Resolves when the timer is set.
|
|
89
88
|
* @throws {Error} If the timer type is invalid.
|
|
@@ -100,7 +99,8 @@ class Power {
|
|
|
100
99
|
* @example
|
|
101
100
|
* await sos.management.power.setTimer("TIMER_1", "08:00:00", "22:00:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], 30);
|
|
102
101
|
*/
|
|
103
|
-
async setTimer(type, timeOn, timeOff, weekdays,
|
|
102
|
+
async setTimer(type, timeOn, timeOff, weekdays, // TODO: remove AnyString in the next major release
|
|
103
|
+
volume) {
|
|
104
104
|
if (typeof TimerHelper_1.TimerType[type] === 'undefined') {
|
|
105
105
|
throw new Error('Invalid timer type');
|
|
106
106
|
}
|
|
@@ -118,17 +118,13 @@ class Power {
|
|
|
118
118
|
.timerTime();
|
|
119
119
|
(0, Validate_1.default)({ weekdays }).required().array('string');
|
|
120
120
|
(0, Validate_1.default)({ volume }).required().number().min(0).max(100);
|
|
121
|
-
|
|
122
|
-
if (typeof TimerHelper_1.TimerWeekday[weekday] === 'undefined') {
|
|
123
|
-
throw new Error('Invalid timer weekday');
|
|
124
|
-
}
|
|
125
|
-
}
|
|
121
|
+
const shortWeekdays = weekdays.map(PowerHelper_1.coalesceWeekdayType);
|
|
126
122
|
await this.postMessage({
|
|
127
123
|
type: this.getMessage('set_timer'),
|
|
128
124
|
timerType: type,
|
|
129
125
|
timeOn,
|
|
130
126
|
timeOff,
|
|
131
|
-
weekdays,
|
|
127
|
+
weekdays: shortWeekdays,
|
|
132
128
|
volume,
|
|
133
129
|
});
|
|
134
130
|
}
|
|
@@ -189,7 +185,8 @@ class Power {
|
|
|
189
185
|
* @example
|
|
190
186
|
* await sos.management.power.setProprietaryTimer("TIMER_2", "08:00:00", "22:00:00", ["mon", "tue", "wed", "thu", "fri", "sat", "sun"], false);
|
|
191
187
|
*/
|
|
192
|
-
async setProprietaryTimer(type, timeOn, timeOff, weekdays,
|
|
188
|
+
async setProprietaryTimer(type, timeOn, timeOff, weekdays, // TODO: remove AnyString in the next major release
|
|
189
|
+
keepAppletRunning = false) {
|
|
193
190
|
(0, Validate_1.default)({ type })
|
|
194
191
|
.required()
|
|
195
192
|
.string()
|
|
@@ -208,17 +205,13 @@ class Power {
|
|
|
208
205
|
.timerTime();
|
|
209
206
|
(0, Validate_1.default)({ weekdays }).required().array('string');
|
|
210
207
|
(0, Validate_1.default)({ keepAppletRunning }).required().boolean();
|
|
211
|
-
|
|
212
|
-
if (typeof TimerHelper_1.TimerWeekday[weekday] === 'undefined') {
|
|
213
|
-
throw new Error('Invalid timer weekday');
|
|
214
|
-
}
|
|
215
|
-
}
|
|
208
|
+
const shortWeekdays = weekdays.map(PowerHelper_1.coalesceWeekdayType);
|
|
216
209
|
await this.postMessage({
|
|
217
210
|
type: this.getMessage('set_proprietary_timer'),
|
|
218
211
|
timerType: type,
|
|
219
212
|
timeOn,
|
|
220
213
|
timeOff,
|
|
221
|
-
weekdays,
|
|
214
|
+
weekdays: shortWeekdays,
|
|
222
215
|
keepAppletRunning,
|
|
223
216
|
});
|
|
224
217
|
}
|
|
@@ -264,7 +257,7 @@ class Power {
|
|
|
264
257
|
/**
|
|
265
258
|
* Returns all scheduled reboot rules on the device set by the `setScheduledReboot()` method.
|
|
266
259
|
*
|
|
267
|
-
* @returns {Promise<
|
|
260
|
+
* @returns {Promise<IScheduledRebootAction[]>} Resolves with an array of scheduled reboot actions.
|
|
268
261
|
* @since 8.1.0
|
|
269
262
|
*
|
|
270
263
|
* @example
|
|
@@ -275,12 +268,15 @@ class Power {
|
|
|
275
268
|
type: this.getMessage('get_scheduled_reboots'),
|
|
276
269
|
});
|
|
277
270
|
// We need to convert the values of days back to a string representation
|
|
278
|
-
|
|
279
|
-
action
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
271
|
+
const outputActions = actions.map((action) => ({
|
|
272
|
+
...action,
|
|
273
|
+
rule: {
|
|
274
|
+
...action.rule,
|
|
275
|
+
weekdays: action.rule.weekdays.map(PowerHelper_1.convertNumberToWeekday),
|
|
276
|
+
shortWeekdays: action.rule.weekdays.map(PowerHelper_1.coalesceWeekdayType),
|
|
277
|
+
},
|
|
278
|
+
}));
|
|
279
|
+
return outputActions;
|
|
284
280
|
}
|
|
285
281
|
/**
|
|
286
282
|
* Removes scheduled reboot rule from the device (if it exists).
|
|
@@ -329,16 +325,11 @@ class Power {
|
|
|
329
325
|
* // Schedule reboot every Monday and Friday at 7:30 PM / 19:30
|
|
330
326
|
* await sos.management.power.setScheduledReboot(["MONDAY", "FRIDAY"], "19:30:00");
|
|
331
327
|
*/
|
|
332
|
-
async setScheduledReboot(weekdays,
|
|
328
|
+
async setScheduledReboot(weekdays, // TODO: remove AnyString in the next major release
|
|
329
|
+
time) {
|
|
333
330
|
(0, Validate_1.default)({ weekdays }).required().array('string');
|
|
334
|
-
// Validate if day is in weekday enum
|
|
335
|
-
for (const weekday of weekdays) {
|
|
336
|
-
if (typeof IPower_1.WeekdayNamed[weekday] === 'undefined') {
|
|
337
|
-
throw new Error('Invalid weekday');
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
331
|
// Days in week need to be converted to specific numbers to work properly
|
|
341
|
-
const weekdayAsNumbers = weekdays.map(PowerHelper_1.
|
|
332
|
+
const weekdayAsNumbers = weekdays.map(PowerHelper_1.convertBCWeekdayToNumber);
|
|
342
333
|
(0, Validate_1.default)({ time })
|
|
343
334
|
.required()
|
|
344
335
|
.string()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Power.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Power/Power.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"Power.js","sourceRoot":"","sources":["../../../../src/FrontApplet/Management/Power/Power.ts"],"names":[],"mappings":";;;;;AAEA,uEAA+C;AAE/C,wDAA2D;AAE3D,+CAAsG;AAEtG;;;;;;;;;;;;;;;;GAgBG;AACH,MAAqB,KAAK;IAGhB;IACA;IAHT,gBAAgB;IAChB,YACS,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AQ,EAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAElD,yEAAyE;QACzE,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,CAAC,sCAAwB,CAAC,CAAC;QAEhE,IAAA,kBAAQ,EAAC,EAAE,IAAI,EAAE,CAAC;aAChB,QAAQ,EAAE;aACV,MAAM,EAAE;aACR,WAAW,CAAC,mBAAmB,CAAC;aAChC,SAAS,EAAE,CAAC;QAEd,MAAM,IAAI,GAA4B;YACrC,QAAQ,EAAE,gBAAgB;YAC1B,IAAI;SACJ,CAAC;QAEF,MAAM,IAAI,CAAC,WAAW,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC;YAC7C,IAAI;SACJ,CAAC,CAAC;IACJ,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,IAAI,CAAC;IACxC,CAAC;CACD;AAtWD,wBAsWC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { AnyString } from '../../../utils/types';
|
|
2
|
+
import { ShortWeekdayType, WeekdayNumbered, WeekdayNumberType, WeekdayType } from './IPower';
|
|
3
|
+
export type BackwardsCompatibleWeekdayType = WeekdayType | ShortWeekdayType | WeekdayNumberType | AnyString;
|
|
4
|
+
export declare const SHORT_WEEKDAYS: readonly ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
|
|
5
|
+
export declare function convertWeekdayToNumber(weekday: WeekdayType): WeekdayNumberType;
|
|
6
|
+
export declare function convertBCWeekdayToNumber(weekday: BackwardsCompatibleWeekdayType): WeekdayNumberType;
|
|
7
|
+
export declare function convertNumberToWeekday(weekday: number): keyof typeof WeekdayNumbered;
|
|
8
|
+
export declare const coalesceWeekdayType: (weekday: BackwardsCompatibleWeekdayType) => ShortWeekdayType;
|