@proteus-vue/render-backend 0.1.0
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/README.md +75 -0
- package/dist/basic-containers.d.ts +87 -0
- package/dist/borrow-checker.d.ts +21 -0
- package/dist/conformance-component.d.ts +32 -0
- package/dist/conformance.d.ts +18 -0
- package/dist/container-conformance.d.ts +53 -0
- package/dist/container-spi.d.ts +169 -0
- package/dist/dispatcher.d.ts +98 -0
- package/dist/flutter.d.ts +16 -0
- package/dist/headless.d.ts +12 -0
- package/dist/host-conformance.d.ts +71 -0
- package/dist/host-matrix.d.ts +74 -0
- package/dist/hot-switch.d.ts +24 -0
- package/dist/hybrid.d.ts +60 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.js +4291 -0
- package/dist/native.d.ts +42 -0
- package/dist/ownership-observability.d.ts +99 -0
- package/dist/ownership.d.ts +206 -0
- package/dist/page-ownership.d.ts +55 -0
- package/dist/pss.d.ts +54 -0
- package/dist/spi.d.ts +73 -0
- package/dist/stack-container.d.ts +43 -0
- package/dist/superapp-container.d.ts +47 -0
- package/dist/vue-bridge.d.ts +22 -0
- package/dist/vue-dom.d.ts +6 -0
- package/dist/web-host.d.ts +35 -0
- package/package.json +30 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { HostRuntimeLike } from './host-conformance';
|
|
2
|
+
/** Worker 句柄(真实 Worker 或降级 fake) */
|
|
3
|
+
export interface WebWorkerHandle {
|
|
4
|
+
id: string;
|
|
5
|
+
thread: string;
|
|
6
|
+
/** 真实 Web Worker 实例(浏览器环境);SSR/测试降级为 null */
|
|
7
|
+
raw: unknown;
|
|
8
|
+
/** 终止(真实 worker.terminate() / fake 清空) */
|
|
9
|
+
terminate(): void;
|
|
10
|
+
}
|
|
11
|
+
export interface WebHostRuntime extends HostRuntimeLike {
|
|
12
|
+
readonly id: 'web';
|
|
13
|
+
/** override:workers 为 Web worker 句柄(含 terminate;SSR 降级 raw=null 诚实声明) */
|
|
14
|
+
workers: WebWorkerHandle[];
|
|
15
|
+
/** override:Web worker 句柄 */
|
|
16
|
+
createWorker(scriptUrl?: string): WebWorkerHandle;
|
|
17
|
+
/** 微任务灌入 Event Loop(真实异步路径:await host.flush() 后队列任务执行) */
|
|
18
|
+
flush(): Promise<void>;
|
|
19
|
+
/** visibilitychange → suspend/resume 挂钩(绑定 window/document;返回解绑;SSR 无 document 时安全跳过) */
|
|
20
|
+
bindPageVisibility(): () => void;
|
|
21
|
+
}
|
|
22
|
+
export interface WebHostOptions {
|
|
23
|
+
/** Worker 工厂(缺省:浏览器 new Worker(url) / 非浏览器降级 fake——诚实声明) */
|
|
24
|
+
createWorkerImpl?: (scriptUrl?: string) => {
|
|
25
|
+
raw: unknown;
|
|
26
|
+
terminate(): void;
|
|
27
|
+
};
|
|
28
|
+
/** document/window 宿主(缺省用全局;注入可单测) */
|
|
29
|
+
env?: {
|
|
30
|
+
document?: Document;
|
|
31
|
+
EventTarget?: typeof EventTarget;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** ★G-41 B4 Web 宿主运行时(Main + Worker + Event Loop 骨架) */
|
|
35
|
+
export declare function createWebHostRuntime(opts?: WebHostOptions): WebHostRuntime;
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@proteus-vue/render-backend",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "G-27 ProteusRenderBackend SPI:可插拔渲染后端接口 + conformance test + 官方后端原型(Headless/VueDom) + G-41 nodeOps Dispatcher——Render anywhere, on any engine(M1.4)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@proteus-vue/component-ir": "0.1.0"
|
|
9
|
+
},
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"@vue/runtime-core": "^3.4.0"
|
|
12
|
+
},
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"README.md"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json --emitDeclarationOnly && esbuild src/index.ts --bundle --format=esm --platform=neutral --outfile=dist/index.js --external:@vue/runtime-core"
|
|
29
|
+
}
|
|
30
|
+
}
|