UNPKG

@microsoft/windows-admin-center-sdk

Version:

Microsoft - Windows Admin Center Shell

1 lines 1.98 kB
{"version":3,"sources":["../../../packages/core/rpc/alive/rpc-alive-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAe,MAAM,mBAAmB,CAAC;AAE9D,qBAAa,cAAc;IACvB;;;;;;OAMG;WACW,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAQjE;;;;;OAKG;WACW,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9C;;;;;OAKG;WACW,KAAK,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAI/C","file":"rpc-alive-client.d.ts","sourcesContent":["import { Rpc } from '../rpc';\r\nimport { RpcInboundClient } from '../rpc-inbound-client';\r\nimport { RpcAliveData, RpcAliveKey } from './rpc-alive-model';\r\n\r\nexport class RpcAliveClient {\r\n /**\r\n * The alive command.\r\n *\r\n * @param rpc the Rpc instance.\r\n * @param data the Rpc alive data object.\r\n * @return Promise<void> the promise object.\r\n */\r\n public static alive(rpc: Rpc, data?: RpcAliveData): Promise<void> {\r\n if (!data) {\r\n data = { timestamp: Date.now() };\r\n }\r\n\r\n return RpcInboundClient.call(rpc, RpcAliveKey.command, RpcAliveKey.version, data);\r\n }\r\n\r\n /**\r\n * The alive forever command.\r\n *\r\n * @param rpc the Rpc instance.\r\n * @return Promise<void> the promise object.\r\n */\r\n public static forever(rpc: Rpc): Promise<void> {\r\n const data: RpcAliveData = { timestamp: Date.now(), forever: true };\r\n return RpcInboundClient.call(rpc, RpcAliveKey.command, RpcAliveKey.version, data);\r\n }\r\n\r\n /**\r\n * The reset forever state command.\r\n *\r\n * @param rpc the Rpc instance.\r\n * @return Promise<void> the promise object.\r\n */\r\n public static reset(rpc: Rpc): Promise<void> {\r\n const data: RpcAliveData = { timestamp: Date.now(), forever: false };\r\n return RpcInboundClient.call(rpc, RpcAliveKey.command, RpcAliveKey.version, data);\r\n }\r\n}\r\n"]}