tauri-plugin-z9 0.1.2 → 0.1.4
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.
- package/dist-js/index.d.mts +15 -0
- package/dist-js/index.mjs +23 -1
- package/package.json +1 -1
package/dist-js/index.d.mts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
//#region guest-js/index.d.ts
|
|
2
2
|
export declare function minimizeApp(): Promise<undefined | string>;
|
|
3
|
+
export type Insets = {
|
|
4
|
+
top: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
left: number;
|
|
7
|
+
right: number;
|
|
8
|
+
};
|
|
9
|
+
export type InsetsResult = {
|
|
10
|
+
statusBars?: Insets;
|
|
11
|
+
navigationBars?: Insets;
|
|
12
|
+
displayCutout?: Insets;
|
|
13
|
+
ime?: Insets;
|
|
14
|
+
systemGestures?: Insets;
|
|
15
|
+
};
|
|
16
|
+
export declare function insets(): Promise<InsetsResult>;
|
|
17
|
+
export declare function mergeInsets(...allInsets: (Insets | undefined)[]): Insets;
|
|
3
18
|
//#endregion
|
package/dist-js/index.mjs
CHANGED
|
@@ -3,5 +3,27 @@ import { invoke } from "@tauri-apps/api/core";
|
|
|
3
3
|
async function minimizeApp() {
|
|
4
4
|
return await invoke("plugin:z9|minimize_app");
|
|
5
5
|
}
|
|
6
|
+
async function insets() {
|
|
7
|
+
return await invoke("plugin:z9|insets");
|
|
8
|
+
}
|
|
9
|
+
function mergeInsets(...allInsets) {
|
|
10
|
+
let top = 0;
|
|
11
|
+
let bottom = 0;
|
|
12
|
+
let left = 0;
|
|
13
|
+
let right = 0;
|
|
14
|
+
for (const insets of allInsets) {
|
|
15
|
+
if (!insets) continue;
|
|
16
|
+
if (insets.top > top) top = insets.top;
|
|
17
|
+
if (insets.bottom > bottom) bottom = insets.bottom;
|
|
18
|
+
if (insets.left > left) left = insets.left;
|
|
19
|
+
if (insets.right > right) right = insets.right;
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
top,
|
|
23
|
+
bottom,
|
|
24
|
+
left,
|
|
25
|
+
right
|
|
26
|
+
};
|
|
27
|
+
}
|
|
6
28
|
//#endregion
|
|
7
|
-
export { minimizeApp };
|
|
29
|
+
export { insets, mergeInsets, minimizeApp };
|