diff --git a/apps/widbt2/widget.ts b/apps/widbt2/widget.ts index c63d187a5..d2585f1fb 100644 --- a/apps/widbt2/widget.ts +++ b/apps/widbt2/widget.ts @@ -48,8 +48,8 @@ g.drawImage( atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA=="), - this.x + 2, - this.y + 2 + this.x! + 2, + this.y! + 2 ); }, width: width(), diff --git a/typescript/types/main.d.ts b/typescript/types/main.d.ts index 1223f527d..944d55326 100644 --- a/typescript/types/main.d.ts +++ b/typescript/types/main.d.ts @@ -183,6 +183,23 @@ type NRFFilters = { manufacturerData?: object; }; +type NRFSecurityStatus = { + advertising: boolean, +} & ( + { + connected: true, + encrypted: boolean, + mitm_protected: boolean, + bonded: boolean, + connected_addr?: string, + } | { + connected: false, + encrypted: false, + mitm_protected: false, + bonded: false, + } +); + type ImageObject = { width: number; height: number; @@ -721,7 +738,7 @@ declare class NRF { * @returns {any} An object * @url http://www.espruino.com/Reference#l_NRF_getSecurityStatus */ - static getSecurityStatus(): any; + static getSecurityStatus(): NRFSecurityStatus; /** * @returns {any} An object @@ -1898,6 +1915,7 @@ declare class NRF { * encrypted // Communication on this link is encrypted. * mitm_protected // The encrypted communication is also protected against man-in-the-middle attacks. * bonded // The peer is bonded with us + * advertising // Are we currently advertising? * connected_addr // If connected=true, the MAC address of the currently connected device * } * ``` @@ -1906,7 +1924,7 @@ declare class NRF { * @returns {any} An object * @url http://www.espruino.com/Reference#l_NRF_getSecurityStatus */ - static getSecurityStatus(): any; + static getSecurityStatus(): NRFSecurityStatus; /** * @@ -4553,7 +4571,7 @@ declare class BluetoothRemoteGATTServer { * @returns {any} An object * @url http://www.espruino.com/Reference#l_BluetoothRemoteGATTServer_getSecurityStatus */ - getSecurityStatus(): any; + getSecurityStatus(): NRFSecurityStatus; /** * See `NRF.connect` for usage examples.