mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-23 05:24:46 -07:00
JS: Expose button event type in gui/widget button callback
by WillyJL
This commit is contained in:
@@ -58,12 +58,16 @@ type Element = StringMultilineElement
|
||||
|
||||
type Props = {};
|
||||
type Child = Element;
|
||||
declare class ButtonEvent {
|
||||
key: "left" | "center" | "right";
|
||||
type: "press" | "release" | "short" | "long" | "repeat";
|
||||
}
|
||||
declare class Widget extends View<Props, Child> {
|
||||
/**
|
||||
* Event source for buttons. Only gets fired if there's a corresponding
|
||||
* button element.
|
||||
*/
|
||||
button: Contract<"left" | "center" | "right">;
|
||||
button: Contract<ButtonEvent>;
|
||||
}
|
||||
declare class WidgetFactory extends ViewFactory<Props, Child, Widget> { }
|
||||
declare const factory: WidgetFactory;
|
||||
|
||||
Reference in New Issue
Block a user