JS: Fix merge of 3963 and 3961 (#3980)

* toString() was moved, not duplicated
* These had gotten lost
* This is now implemented
* Add missing version doctags
This commit is contained in:
WillyJL
2024-11-01 04:52:54 +00:00
committed by GitHub
parent f4887ed31c
commit 69aa4cd254
4 changed files with 64 additions and 19 deletions

View File

@@ -30,7 +30,7 @@
* |----------------------|------------------|
* | `button_menu` | ❌ |
* | `button_panel` | ❌ |
* | `byte_input` | |
* | `byte_input` | |
* | `dialog_ex` | ✅ (as `dialog`) |
* | `empty_screen` | ✅ |
* | `file_browser` | ❌ |
@@ -122,11 +122,26 @@ import type { Contract } from "../event_loop";
type Properties = { [K: string]: any };
export declare class View<Props extends Properties> {
/**
* Assign value to property by name
* @param property Name of the property
* @param value Value to assign
* @version Added in JS SDK 0.1
*/
set<P extends keyof Props>(property: P, value: Props[P]): void;
}
export declare class ViewFactory<Props extends Properties, V extends View<Props>> {
/**
* Create view instance with default values, can be changed later with set()
* @version Added in JS SDK 0.1
*/
make(): V;
/**
* Create view instance with custom values, can be changed later with set()
* @param initial Dictionary of property names to values
* @version Added in JS SDK 0.1
*/
makeWith(initial: Partial<Props>): V;
}
@@ -144,6 +159,11 @@ declare class ViewDispatcher {
* @version Added in JS SDK 0.1
*/
navigation: Contract;
/**
* View object currently shown
* @version Added in JS SDK 0.1
*/
currentView: View<any>;
/**
* Sends a number to the custom event handler
* @param event number to send