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:
@@ -6,7 +6,7 @@
|
||||
"start": "npm run build && node node_modules/@darkflippers/fz-sdk-ul/sdk.js upload"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@darkflippers/fz-sdk-ul": "^0.1",
|
||||
"@next-flip/fz-sdk-mntm": "^0.3",
|
||||
"typescript": "^5.6.3"
|
||||
}
|
||||
}
|
||||
@@ -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