mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-13 13:09:49 +04:00
JS: Update and fix docs, fix Number.toString() with decimals (#4168)
* Update and fix JS docs This could really use some automation, atleast for API reference There are TypeScript definitions and typedocs, we don't need to be monkeys copying and reformatting this to API reference by hand * Fix bugged character * JS: Fix Number.toString() with decimals * Fix * Forgot this one * docs: mention per-view child format * Added @portasynthinca3 to docs' codeowners * Updated CODEOWNERS --------- Co-authored-by: Anna Antonenko <portasynthinca3@gmail.com> Co-authored-by: hedger <hedger@nanode.su> Co-authored-by: hedger <hedger@users.noreply.github.com>
This commit is contained in:
52
documentation/js/js_flipper.md
Normal file
52
documentation/js/js_flipper.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# Flipper module {#js_flipper}
|
||||
|
||||
The module contains methods and values to query device information and properties. Call the `require` function to load the module before first using its methods:
|
||||
|
||||
```js
|
||||
let flipper = require("flipper");
|
||||
```
|
||||
|
||||
# Values
|
||||
|
||||
## firmwareVendor
|
||||
String representing the firmware installed on the device.
|
||||
Original firmware reports `"flipperdevices"`.
|
||||
Do **NOT** use this to check the presence or absence of features, refer to [other ways to check SDK compatibility](#js_builtin_sdk_compatibility).
|
||||
|
||||
## jsSdkVersion
|
||||
Version of the JavaScript SDK.
|
||||
Do **NOT** use this to check the presence or absence of features, refer to [other ways to check SDK compatibility](#js_builtin_sdk_compatibility).
|
||||
|
||||
<br>
|
||||
|
||||
---
|
||||
|
||||
# Methods
|
||||
|
||||
## getModel()
|
||||
Returns the device model.
|
||||
|
||||
**Example**
|
||||
```js
|
||||
flipper.getModel(); // "Flipper Zero"
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## getName()
|
||||
Returns the name of the virtual dolphin.
|
||||
|
||||
**Example**
|
||||
```js
|
||||
flipper.getName(); // "Fur1pp44"
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## getBatteryCharge()
|
||||
Returns the battery charge percentage.
|
||||
|
||||
**Example**
|
||||
```js
|
||||
flipper.getBatteryCharge(); // 100
|
||||
```
|
||||
Reference in New Issue
Block a user