@nativedesktop/react 0.4.5 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -133,6 +133,11 @@ export interface WebViewInfo {
|
|
|
133
133
|
canGoBack: boolean;
|
|
134
134
|
canGoForward: boolean;
|
|
135
135
|
}
|
|
136
|
+
/** `items` is the LIVE native menu model flattened in draw order (the GMenuModel the owner carries on GTK, the NSMenu it carries on AppKit), never the React tree. A nested submenu contributes its own entry followed by its children prefixed `Parent > Child`; a separator (a GMenu section boundary, an NSMenuItem separator) is the entry `---`, never leading, trailing, or doubled. */
|
|
137
|
+
export interface MenuModelResult {
|
|
138
|
+
ref: number;
|
|
139
|
+
items: string[];
|
|
140
|
+
}
|
|
136
141
|
/** `value` is the result's STRING rendering (the engine's own JSValue-to-string), the same shape the javaScriptResult event carries — never a typed JSON value. On a thrown exception `ok` is false and `error` carries the engine's message. */
|
|
137
142
|
export interface WebViewEvalResult {
|
|
138
143
|
ref: number;
|
|
@@ -250,6 +255,12 @@ export interface WebviewInfoParams {
|
|
|
250
255
|
testId?: string;
|
|
251
256
|
window?: number;
|
|
252
257
|
}
|
|
258
|
+
/** Reads a menu owner's live native menu back, flattened in draw order, so a drive can assert what the user would actually see instead of what the React tree says. Targets a Menubar node (the installed app menu, including the platform's default menus on AppKit), a MenuButton/SplitButton, or a TrayItem; a Menu node answers -32602, since a <menu> only ever draws inside one of those owners. Target by exactly one of ref / testId. */
|
|
259
|
+
export interface MenuModelParams {
|
|
260
|
+
ref?: number;
|
|
261
|
+
testId?: string;
|
|
262
|
+
window?: number;
|
|
263
|
+
}
|
|
253
264
|
/** Evaluates `code` in a WebView node's page and answers the result's string rendering. `world` picks an isolated content world by name (absent/empty = the page's own world), matching the executeJavaScript command. The engine's evaluation is asynchronous: the host starts it, then polls its own UI thread until it settles or timeoutMs elapses (-32002). A thrown exception is a RESULT with ok:false, not an RPC error. Target by exactly one of ref / testId; a target that is not a WebView answers -32602. */
|
|
254
265
|
export interface WebviewEvalParams {
|
|
255
266
|
ref?: number;
|
|
@@ -350,6 +361,10 @@ export interface RpcMethods {
|
|
|
350
361
|
params: WebviewInfoParams;
|
|
351
362
|
result: WebViewInfo;
|
|
352
363
|
};
|
|
364
|
+
menuModel: {
|
|
365
|
+
params: MenuModelParams;
|
|
366
|
+
result: MenuModelResult;
|
|
367
|
+
};
|
|
353
368
|
webviewEval: {
|
|
354
369
|
params: WebviewEvalParams;
|
|
355
370
|
result: WebViewEvalResult;
|