@proteus-vue/render-backend 0.3.0-beta.11 → 0.3.0-beta.23
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/app-navigation.d.ts +57 -0
- package/dist/app-navigation.js +3017 -0
- package/dist/host-conformance.d.ts +7 -0
- package/dist/host-invoke-contract.d.ts +8 -0
- package/dist/host-invoke-contract.js +47 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +3054 -60
- package/dist/native.d.ts +67 -1
- package/dist/quickjs-host.d.ts +77 -0
- package/dist/screen-executor-host.d.ts +67 -0
- package/dist/screen-executor-host.js +151 -0
- package/dist/screen-executor.d.ts +239 -0
- package/dist/screen-executor.js +165 -0
- package/dist/screen-runtime.d.ts +96 -0
- package/dist/selfdraw-batch.d.ts +47 -0
- package/dist/spi.d.ts +4 -0
- package/dist/superapp-runtime.d.ts +83 -0
- package/dist/tab-bar-spec.d.ts +35 -0
- package/dist/tab-bar-spec.js +17 -0
- package/dist/vue-dom.d.ts +1 -0
- package/package.json +23 -5
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { AppScreenSpec, AppStack, AppStackPolicy } from '@proteus-vue/router/app-stack';
|
|
2
|
+
import { createAppNavigationAdapter } from '@proteus-vue/router/app-route';
|
|
3
|
+
import type { RouteRecord } from '@proteus-vue/router/types';
|
|
4
|
+
import { type ScreenExecutor, type ScreenContentProvider } from './screen-executor';
|
|
5
|
+
import { type HostInvokeChannel } from './screen-executor-host';
|
|
6
|
+
export interface AppNavigationOptions {
|
|
7
|
+
/** 宿主通道(同步字符串往返;Android/iOS 壳已注入 `proteusHost.invoke`) */
|
|
8
|
+
invoke: HostInvokeChannel;
|
|
9
|
+
/**
|
|
10
|
+
* 屏注册表:与 `createAppStack` 同源。
|
|
11
|
+
* ★二选一:直接给 `screens`,或给 `routes`(本函数用 `screensFromRoutes` 推导——推荐,
|
|
12
|
+
* 消灭"手抄屏注册表"这段胶水)。
|
|
13
|
+
*/
|
|
14
|
+
screens?: Record<string, AppScreenSpec>;
|
|
15
|
+
/** 路由表(`gen-routes` 产物;给了它就不必给 screens) */
|
|
16
|
+
routes?: RouteRecord[];
|
|
17
|
+
/** 内存治理策略(传给 `createAppStack`) */
|
|
18
|
+
policy?: AppStackPolicy;
|
|
19
|
+
/** ★批次 43:**屏内容提供者**(页面真实内容;缺省 ⇒ 空壳)——真实应用入口据此装页面 */
|
|
20
|
+
contentOf?: ScreenContentProvider;
|
|
21
|
+
/** 建屏完成通知(默认接 `stack.markRebuilt`——契约要求执行器建完调它) */
|
|
22
|
+
onScreenMounted?: (screenId: string, rebuild: boolean) => void;
|
|
23
|
+
/** 诊断事件(端口调用序——判据/测试读它) */
|
|
24
|
+
onEvent?: (e: {
|
|
25
|
+
type: string;
|
|
26
|
+
screenId?: string;
|
|
27
|
+
detail?: unknown;
|
|
28
|
+
}) => void;
|
|
29
|
+
/**
|
|
30
|
+
* 自动泵(默认 true):栈操作产生的命令在**同一微任务**里交给执行器。
|
|
31
|
+
* ★关掉它 = 回到手工 `drainCommands`(仅用于需要自己控拍的场景)。
|
|
32
|
+
*/
|
|
33
|
+
autoPump?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface AppNavigation {
|
|
36
|
+
/** 虚拟路由栈(诊断/深栈读数用;正常导航走 adapter) */
|
|
37
|
+
stack: AppStack;
|
|
38
|
+
/** 命令流执行器(诊断/stats 用) */
|
|
39
|
+
executor: ScreenExecutor;
|
|
40
|
+
/** RouterAdapter(直接喂给 `createRouter(routes, { adapter })`) */
|
|
41
|
+
adapter: ReturnType<typeof createAppNavigationAdapter>;
|
|
42
|
+
/** 等当前命令流全部 settle(真机场景收工点;`router.push` 内部已 await) */
|
|
43
|
+
flush(): Promise<void>;
|
|
44
|
+
/** 宿主记账(`screen.stats`;判据读它——证明"动作真发生") */
|
|
45
|
+
hostStats(): unknown;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 装配 App 端导航:栈 + 执行器 + 宿主端口 + Router 适配器。
|
|
49
|
+
*
|
|
50
|
+
* 用法(宿主 JS 入口,QuickJS/JSC 里):
|
|
51
|
+
* ```ts
|
|
52
|
+
* const nav = createAppNavigation({ invoke: (m, a) => proteusHost.invoke(m, a), routes })
|
|
53
|
+
* const router = createRouter(routes, { adapter: nav.adapter })
|
|
54
|
+
* router.push({ name: 'detail', params: { id: 1 } }) // ← 零胶水
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function createAppNavigation(opts: AppNavigationOptions): AppNavigation;
|