import IPostMessage from '../../IPostMessage'; import ISecurity from './ISecurity'; /** * The `sos.management.security` API groups together methods for the management of a security PIN code of the device. */ export default class Security implements ISecurity { private messagePrefix; private postMessage; /** @internal */ constructor(messagePrefix: string, postMessage: IPostMessage); /** * The `getPinCode()` method returns the currently set PIN code. * * @returns {Promise} A promise that resolves to the currently set PIN code. * @throws {AppletSecurityError} Get PIN code failed because the PIN code has not been set yet. * @since 4.1.0 * * @example * const pinCode = await sos.management.security.getPinCode(); * console.log(`Current PIN code is: ${pinCode}`); */ getPinCode(): Promise; /** * The `setPinCode()` method sets the pin code. * * :::warning * The maximum length of the PIN code is four characters. * ::: * * @param pinCode The PIN code to be set. * @return {Promise} A promise that resolves when the PIN code is successfully set. * @throws {AppletSecurityError} Invalid PIN code format. * @throws {AppletSecurityError} PIN code 0000 is not allowed, use another PIN code. * @since 4.1.0 * * @example // {@link https://github.com/signageos/applet-examples/tree/master/examples/management-js-api/security-pin-code | Applet Example with PIN setup} * * @example * await sos.management.security.setPinCode("9999"); */ setPinCode(pinCode: string): Promise; /** * The `generateRandomPinCode()` generates a random 4-digit PIN code and sets it as the current PIN code. * * @return {Promise} A promise that resolves when the random PIN code is successfully set. * @since 4.1.0 * * @example * await sos.management.security.generateRandomPinCode(); // Generate new random PIN code * const newPinCode = await sos.management.security.getPinCode(); // Get PIN code as string * console.log(newPinCode); */ generateRandomPinCode(): Promise; private getMessage; }