Skip to content

Commit ac9d785

Browse files
committed
update webuix docs
1 parent 1999050 commit ac9d785

3 files changed

Lines changed: 100 additions & 44 deletions

File tree

docs/en/guide/webuix/config.md

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,10 @@ Location:
77
- `/data/adb/modules/<ID>/webroot/config.json`
88
- `/data/adb/modules/<ID>/webroot/config.mmrl.json`
99

10-
## Example Usage
10+
::: code-group
1111

12-
```jsonc
13-
{
14-
"require": {
15-
/**
16-
"packages" is available from following apps:
17-
- MMRL version code 33633
18-
- WebUI X Portable version code 29
19-
*/
20-
"packages": [
21-
{
22-
"code": 33624,
23-
"packageName": ["com.dergoogler.mmrl", "com.dergoogler.mmrl.debug"],
24-
"supportText": "Update",
25-
"supportLink": "https://github.com/MMRLApp/MMRL/releases"
26-
},
27-
{
28-
"code": 26,
29-
"packageName": "com.dergoogler.mmrl.wx",
30-
"supportText": "Update",
31-
"supportLink": "https://github.com/MMRLApp/WebUI-X-Portable/releases"
32-
}
33-
],
34-
/**
35-
"version" is deprecated from following apps:
36-
- MMRL version code 33633
37-
- WebUI X Portable version code 29
38-
*/
39-
"version": {
40-
"required": 2,
41-
"supportText": "Please update to the latest version.",
42-
"supportLink": "https://support.example.com"
43-
}
44-
},
45-
"permissions": ["webui.permission.PLUGIN_DEX_LOADER", "webui.permission.DSL_DEX_LOADING"],
46-
"historyFallback": true,
47-
"title": "My WebUI",
48-
"icon": "icon.png",
49-
"windowResize": true,
50-
"backHandler": true,
51-
"exitConfirm": true,
52-
"historyFallbackFile": "fallback.html"
53-
}
54-
```
12+
<<< @/webui-x-types/config/Config.ts
13+
14+
<<< @/webui-x-types/config/Require.ts
15+
16+
:::
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import { Require } from "./Require";
2+
3+
type BackInterceptor = "native" | "javascript" | boolean | null;
4+
5+
export interface Config {
6+
/**
7+
* Configuration for required dependencies for the WebUI.
8+
*/
9+
require: Require;
10+
11+
/**
12+
* List of permissions required by the Web UI.
13+
*/
14+
permissions: Array<string>;
15+
16+
/**
17+
* Whether the WebUI should fallback to the `historyFallbackFile` if a route is not found.
18+
* @default false
19+
*/
20+
historyFallback: boolean;
21+
22+
/**
23+
* The title of the WebUI window. If null, the default title of the underlying platform will be used.
24+
*/
25+
title: string | null;
26+
27+
/**
28+
* The path to the icon of the WebUI. If null, the default icon of the underlying platform will be used.
29+
*/
30+
icon: string | null;
31+
32+
/**
33+
* Whether the WebUI window should be resizable.
34+
* @default true
35+
*/
36+
windowResize: boolean;
37+
38+
/**
39+
* @deprecated
40+
* Use `backInterceptor` instead.
41+
* Whether the WebUI should handle the back button/gesture events.
42+
* @default true
43+
*/
44+
backHandler: boolean | null;
45+
46+
/**
47+
* The interceptor to use for the back button/gesture events. If set to `null` or `false`, the default behavior of the underlying platform will be used.
48+
* @default null
49+
*/
50+
backInterceptor: BackInterceptor;
51+
52+
/**
53+
* Whether the WebUI should support pull-to-refresh functionality.
54+
* This is typically used in mobile web applications to allow users to refresh the content by pulling down.
55+
* @default true
56+
*/
57+
pullToRefresh: boolean;
58+
59+
/**
60+
* Whether the WebUI should show a confirmation dialog when the user tries to exit.
61+
* @default true
62+
*/
63+
exitConfirm: boolean;
64+
65+
/**
66+
* The file to use as a fallback when `historyFallback` is enabled.
67+
* @default "index.html"
68+
*/
69+
historyFallbackFile: string;
70+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
interface Package {
2+
code: number;
3+
packageName: string | Array<string>;
4+
supportText: string | null;
5+
supportLink: string | null;
6+
}
7+
8+
/**
9+
* @deprecated
10+
*/
11+
interface Version {
12+
required: number;
13+
supportText: string | null;
14+
supportLink: string | null;
15+
}
16+
17+
export interface Require {
18+
packages: Array<Package>;
19+
/**
20+
* @deprecated
21+
* Use `packages` instead.
22+
*/
23+
version: Version;
24+
}

0 commit comments

Comments
 (0)