import IPostMessage from '../IPostMessage'; import App from './App/App'; import Audio from './Audio/Audio'; import AutoRecovery from './AutoRecovery/AutoRecovery'; import Debug from './Debug/Debug'; import Firmware from './Firmware/Firmware'; import IBatteryStatus from './IBatteryStatus'; import IManagement, { ManagementCapability } from './IManagement'; import INetworkInfo from './Network/INetworkInfo'; import Network from './Network/Network'; import OS from './OS/OS'; import Package from './Package/Package'; import PeerRecovery from './PeerRecovery/PeerRecovery'; import Power from './Power/Power'; import Proxy from './Proxy/Proxy'; import RemoteControl from './RemoteControl/RemoteControl'; import Screen from './Screen/Screen'; import Security from './Security/Security'; import Time from './Time/Time'; import Wifi from './Wifi/Wifi'; /** * The `sos.management` API group provides methods for managing the device. Through this API, things like device firmware, * battery status, brightness, network information, remote control, power, time, or volume can be monitored. * * :::note GitHub Example * - [Basic usage of the Management API](https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/basics) * - [Getting basic management data](https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/js-management-getters) * - [Setting management data](https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/js-management-setters) * ::: * *
* Management Capabilities * | Capability | Description | * |:------------|:-------------| * | `MODEL` | If device can return proper model name | * | `SERIAL_NUMBER` | If device can return serial number | * | `BATTERY_STATUS` | If device can return battery status | * | `TEMPERATURE` | If device can return current temperature | * | `BRAND` | If device can return manufacturer brand | * | `FACTORY_RESET` | If device can perform factory reset | * | `EXTENDED_MANAGEMENT` | If device can return or set extended management URL | * | `HARDWARE_ACCELERATION` | If device can turn hardware acceleration on or off | * * If you want to check if the device supports those capabilities, use [`sos.management.supports()`](https://developers.signageos.io/sdk/sos_management/#supports). *
*/ export default class Management implements IManagement { private messagePrefix; private postMessage; static MESSAGE_PREFIX: string; readonly app: App; readonly os: OS; readonly audio: Audio; readonly debug: Debug; readonly firmware: Firmware; readonly package: Package; readonly power: Power; readonly remoteControl: RemoteControl; readonly screen: Screen; readonly time: Time; readonly network: Network; readonly wifi: Wifi; readonly security: Security; readonly proxy: Proxy; readonly autoRecovery: AutoRecovery; readonly peerRecovery: PeerRecovery; /** @internal */ constructor(messagePrefix: string, postMessage: IPostMessage); /** * The `supports()` method determines whether a queried capability is supported. * * #### What are capabilities? * Capabilities are features or functionalities that a device can support. We divided those capabilities into `front` and `management` capabilities. * This section is about management capabilities, which include features to manage the device, receive information about the device, or change its settings. * * On the other hand, the `front` capabilities are features that are related to the application running on the device, such as displaying content, handling user input, etc. * To check `front` capabilities, refer to the `sos.display.supports()` method or [this section](https://developers.signageos.io/sdk/sos/display#supports). * * :::tip * If you want to check specific capabilities, refer to the sidebar for the selected management section. Every section has its capabilities written in the description, * or check the **ManagementCapability** type in `supports()` method. It has a list of all available capabilities for all platforms. * ::: * * @param capability The capability to check for support. * @returns {Promise} A promise that resolves to `true` if the capability is supported, otherwise `false`. * @throws {Error} If the capability is not a valid string. * @since 2.0.0 * * @example * const isSupported = await sos.management.supports('OS_VERSION'); * console.log(`Is OS_VERSION supported? ${isSupported}`); */ supports(capability: ManagementCapability): Promise; /** * The `getCapabilities()` method returns a list of all supported management capabilities of the device. * * For more information what are capabilities, see the description of the `supports()` method. * * @returns {Promise} A promise that resolves to an array of supported management capabilities. * @since 8.5.0 * * @example * const capabilities = await sos.management.getCapabilities(); * console.log('Supported management capabilities:', capabilities.join(', ')); */ getCapabilities(): Promise; /** * The `getModel()` method returns the model of the device. * * @returns {Promise} A promise that resolves to the model name of the device. * @since 2.0.0 * * @example * const model = await sos.management.getModel(); * console.log(`Device model is: ${model}`); // e.g. 'XC4055' (BrightSign) */ getModel(): Promise; /** * The `getSerialNumber()` method returns the serial number of the device. * * @returns {Promise} A promise that resolves to the serial number of the device. * @since 2.1.0 * * @example * const serialNumber = await sos.management.getSerialNumber(); * console.log(`Device serial number is: ${serialNumber}`); // e.g. '1234567890' */ getSerialNumber(): Promise; /** @deprecated Use `sos.management.network.listInterfaces()` instead. */ getNetworkInfo(): Promise; /** * The `getBatteryStatus()` method returns information about the battery of the device. * * :::note * - Emulator has mocked this method and will always return a battery status with 100% charge. * ::: * * @returns {Promise} A promise that resolves to an object containing the battery status. * @throws {Error} If the device does not support battery status monitoring. * @since 2.1.0 * * @example * const batteryStatus = await sos.management.getBatteryStatus(); * console.log(`Battery status: ${batteryStatus.percentage}% charged`); */ getBatteryStatus(): Promise; /** * The `getTemperature()` method returns the temperature of the device (in the 0-100 range of degrees Celsius). * * @returns {Promise} A promise that resolves to the current temperature of the device. * @throws {Error} If the device does not support temperature monitoring. * @since 3.0.0 * * @example * const temperature = await sos.management.getTemperature(); * console.log(`Current device temperature is: ${temperature}°C`); // e.g. 25°C */ getTemperature(): Promise; /** * The `getBrand()` method returns the manufacturer brand of the device. * * @returns {Promise} A promise that resolves to the brand name of the device. * @throws {Error} If the device does not support brand information. * @since 5.7.0 * * @example * const brand = await sos.management.getBrand(); * console.log(`Device brand is: ${brand}`); // e.g., 'Samsung', 'LG', BrightSign, etc. */ getBrand(): Promise; /** * The `resetSettings()` method initializes the reset of the specific device settings. * * :::warning * This is currently only implemented on the Linux platform. * ::: * * @returns {Promise} A promise that resolves when the settings are reset. * @throws {Error} If the device does not support settings reset. * @since 4.0.0 */ resetSettings(): Promise; /** * The `factoryReset()` method initializes the factory reset of the device. * * @returns {Promise} A promise that resolves when the factory reset is initiated. * @throws {Error} If the device does not support factory reset. * @since 4.0.0 */ factoryReset(): Promise; /** * The `getExtendedManagementUrl()` method returns the management URL of the device. * * :::info * This is currently only implemented for the MagicInfo on the Tizen platform. * ::: * * @returns {Promise} A promise that resolves to the management URL of the device, or `null` if not set. * @throws {Error} If the device does not support the extended management URL. * @since 6.2.0 */ getExtendedManagementUrl(): Promise; /** * The `getExtendedManagementUrl()` sets the management URL of the device. * * :::info * This is currently only implemented for the MagicInfo on the Tizen platform. * ::: * * @param url The management URL to set. If `null`, it will remove the current URL. * @returns {Promise} A promise that resolves when the URL is set. * @throws {Error} If the URL is not a valid string or if the device * @throws {Error} If the device does not support the extended management URL. * @since 6.2.0 * * @example * await sos.management.setExtendedManagementUrl('https://example.com/management'); * // later * const url = await sos.management.getExtendedManagementUrl(); * console.log(`Extended management URL is: ${url}`); // e.g. 'https://example.com/management' */ setExtendedManagementUrl(url: string | null): Promise; /** * The `setHardwareAcceleration()` method turns hardware acceleration on or off. * * :::note * - This is currently only implemented for the BrightSign platform. * - Device must always be rebooted for the changes to take effect. * ::: * * @param enabled Whether hardware acceleration should be enabled. * @returns {Promise} A promise that resolves when the hardware acceleration setting is applied. * @throws {Error} If the `enabled` parameter is not a boolean. * @throws {Error} If the device does not support hardware acceleration management. * @since 7.1.0 * * @example * await sos.management.setHardwareAcceleration(true).then(async () => { * console.log('Hardware acceleration enabled.'); * await sos.management.reboot(); * }).catch((error) => { * console.error('Failed to set hardware acceleration:', error); * }); */ setHardwareAcceleration(enabled: boolean): Promise; /** * The `isHardwareAccelerationEnabled()` method returns whether hardware acceleration is enabled. * * @returns {Promise} A promise that resolves to `true` if hardware acceleration is enabled, otherwise `false`. * @throws {Error} If the device does not support hardware acceleration management. * @since 7.1.0 * * @example * const isEnabled = await sos.management.isHardwareAccelerationEnabled(); * console.log(`Hardware acceleration is ${isEnabled ? 'enabled' : 'disabled'}.`); */ isHardwareAccelerationEnabled(): Promise; private getMessage; private getMessagePrefix; }