mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-23 05:24:46 -07:00
[FL-3925] JS views finished (#4155)
* js: value destructuring and tests * js: temporary fix to see size impact * js_val: reduce code size 1 * i may be stupid. * test: js_value args * Revert "js: temporary fix to see size impact" This reverts commit f51d726dbafc4300d3552020de1c3b8f9ecd3ac1. * pvs: silence warnings * style: formatting * pvs: silence warnings? * pvs: silence warnings?? * js_value: redesign declaration types for less code * js: temporary fix to see size impact * style: formatting * pvs: fix helpful warnings * js_value: reduce .rodata size * pvs: fix helpful warning * js_value: reduce code size 1 * fix build error * style: format * Revert "js: temporary fix to see size impact" This reverts commit d6a46f01794132e882e03fd273dec24386a4f8ba. * style: format * js: move to new arg parser * style: format * feat: all js views done * js, toolbox: generalize string owning * toolbox: silence pvs warning --------- Co-authored-by: hedger <hedger@nanode.su> Co-authored-by: hedger <hedger@users.noreply.github.com>
This commit is contained in:
43
applications/system/js_app/packages/fz-sdk/gui/popup.d.ts
vendored
Normal file
43
applications/system/js_app/packages/fz-sdk/gui/popup.d.ts
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Like a Dialog, but with a built-in timer.
|
||||
*
|
||||
* <img src="../images/popup.png" width="200" alt="Sample screenshot of the view" />
|
||||
*
|
||||
* ```js
|
||||
* let eventLoop = require("event_loop");
|
||||
* let gui = require("gui");
|
||||
* let popupView = require("gui/popup");
|
||||
* ```
|
||||
*
|
||||
* This module depends on the `gui` module, which in turn depends on the
|
||||
* `event_loop` module, so they _must_ be imported in this order. It is also
|
||||
* recommended to conceptualize these modules first before using this one.
|
||||
*
|
||||
* # Example
|
||||
* For an example refer to the `gui.js` example script.
|
||||
*
|
||||
* # View props
|
||||
* - `header`: Text displayed in bold at the top of the screen
|
||||
* - `text`: Text displayed in the middle of the string
|
||||
* - `timeout`: Timeout, in milliseconds, after which the event will fire. The
|
||||
* timer starts counting down when this property is assigned.
|
||||
*
|
||||
* @version Added in JS SDK 0.1
|
||||
* @module
|
||||
*/
|
||||
|
||||
import type { View, ViewFactory } from ".";
|
||||
import type { Contract } from "../event_loop";
|
||||
|
||||
type Props = {
|
||||
header: string,
|
||||
text: string,
|
||||
timeout: number,
|
||||
}
|
||||
type Child = never;
|
||||
declare class Popup extends View<Props, Child> {
|
||||
timeout: Contract;
|
||||
}
|
||||
declare class PopupFactory extends ViewFactory<Props, Child, Popup> { }
|
||||
declare const factory: PopupFactory;
|
||||
export = factory;
|
||||
Reference in New Issue
Block a user