@quicktvui/qtx 0.9.0-alpha.2 → 0.9.0-alpha.3
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/AI_CONTRACT.md +46 -8
- package/README.md +4 -4
- package/dist/capabilities/index.d.ts +10 -0
- package/dist/components/QtxChannelNav/QtxChannelNavBase.vue.d.ts +6 -0
- package/dist/components/QtxChannelNav/types.d.ts +10 -0
- package/dist/core/capabilities.d.ts +119 -0
- package/dist/core/installQtx.d.ts +1 -11
- package/dist/core/theme.d.ts +2 -5
- package/dist/index.d.ts +16 -0
- package/dist/qtx.cjs.js +1 -1
- package/dist/qtx.es.js +323 -66
- package/package.json +3 -2
- package/plugin/qtx-clip-inject.cjs +198 -0
- package/plugin/vite.mjs +31 -0
- package/plugin/webpack.cjs +23 -0
package/AI_CONTRACT.md
CHANGED
|
@@ -35,13 +35,13 @@ qtx 是 **QuickTVUI 平台之上的扩展库**,不是一套独立的 TV 应用
|
|
|
35
35
|
| 宿主工程 | 由 `quicktvui-template` 克隆,不使用通用 Vue 脚手架 | `AGENTS.md`「Project Scaffolding」 |
|
|
36
36
|
| JS 运行时 | `@extscreen/es3-core >=3.0.0`、`@extscreen/es3-vue >=3.0.0`、`vue >=3.2.0`(`peerDependencies`) | `js/qtx/package.json` |
|
|
37
37
|
| 常见宿主依赖 | `@extscreen/es3-component`、`@extscreen/es3-router`、`@quicktvui/quicktvui3`、`@quicktvui/ai`(开发期)均为 `^3.0.0` 系列 | `js/demo/package.json` |
|
|
38
|
-
|
|
|
39
|
-
| npm 包 | `@quicktvui/qtx`,公开 registry `https://registry.npmjs.org
|
|
38
|
+
| 安装渠道 | `@quicktvui/qtx@alpha`(跟随渠道最新发布);需要可复现时锁定具体版本号 | 发布 SOP / `scripts/verify/online-qtx.mjs` |
|
|
39
|
+
| npm 包 | `@quicktvui/qtx`,公开 registry `https://registry.npmjs.org/`;预发布用 dist-tag `alpha`,`latest` 不随其更新 | `CHANGELOG.md` 版本路线 |
|
|
40
40
|
| 宿主运行时 | 由 QuickTVUI 平台提供;`qtx-*` 组件的原生能力随运行时就绪,**接入方无需安装或配置额外组件** | 平台模板项目 / `AGENTS.md` |
|
|
41
41
|
| 播放器 | 本包**不含播放器实现**,播放能力由平台提供,见平台文档的播放器章节 | `CHANGELOG.md` 已知限制 |
|
|
42
42
|
| 设备 | 一台已 `adb connect` 的 TV / 盒子类设备;多设备时须明确指定 serial。若使用线上快应用引擎验收,可跳过本地运行时安装步骤 | `AGENTS.md`「Run To TV Workflow」 |
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
0.9 阶段属于语义化版本的 `0.y.z` 阶段,**允许破坏性变更,不承诺向下兼容**。升级前重新核对组件生成页。
|
|
45
45
|
|
|
46
46
|
> **开发者只需关心 Vue 侧**:安装本包、`app.use(qtx)`、按平台模板写页面。原生能力的探测、装载与版本兼容属于平台运行时的内部实现,不在接入范围内,也不需要写进业务代码或工程配置。若页面长时间停在骨架屏或出现诊断信息,属于运行时环境问题,请把日志交给平台侧排查。
|
|
47
47
|
|
|
@@ -55,8 +55,8 @@ git clone https://github.com/quicktvui/quicktvui-template.git my-tv-app
|
|
|
55
55
|
cd my-tv-app && rm -rf .git
|
|
56
56
|
# 2 修改 package.json 的 name 为 my-tv-app、version 重置为 1.0.0
|
|
57
57
|
yarn install
|
|
58
|
-
# 3 安装 qtx
|
|
59
|
-
npm i @quicktvui/qtx@
|
|
58
|
+
# 3 安装 qtx(跟随 alpha 渠道最新)
|
|
59
|
+
npm i @quicktvui/qtx@alpha
|
|
60
60
|
# 4 环境未就绪时先执行
|
|
61
61
|
quicktvui-ai setup-all-env --project <project-path>
|
|
62
62
|
|
|
@@ -77,6 +77,44 @@ quicktvui-ai run-dev --project <project-path>
|
|
|
77
77
|
5. `run-dev` 到达 runtime launcher 页后,**必须发送一次确认动作**(`adb shell input keyevent 23` 或 `66`)让 runtime 拉取 dev bundle;随后通过 `quicktvui-ai runtime-status`(可用时)或日志确认加载结果,不能停在 launcher 页就宣称完成。
|
|
78
78
|
6. 排错取 `logcat`、`uiautomator dump` 与构建输出原文,并注明宿主平台版本与 qtx 版本。
|
|
79
79
|
|
|
80
|
+
### 2.1 接入 qtx 构建插件(建好工程后加一次)
|
|
81
|
+
|
|
82
|
+
这一步决定「页面默认不裁、写 `overflow: hidden` 能裁」。装完 `@quicktvui/qtx` 后加一个文件、改两条脚本;之后页面里不需要写任何 Android 裁切属性。
|
|
83
|
+
|
|
84
|
+
新建 `scripts/qtx-webpack.config.js`:
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
module.exports = {
|
|
88
|
+
module: {
|
|
89
|
+
rules: [
|
|
90
|
+
{
|
|
91
|
+
// 正则必须带 i 后缀:build-tools 按 test 字符串合并同规则,
|
|
92
|
+
// 不带 i 会与内置 vue-loader 规则合并,本 loader 将拿到拆分后的 JS 而失效。
|
|
93
|
+
test: /\.vue$/i,
|
|
94
|
+
enforce: 'pre',
|
|
95
|
+
use: [require.resolve('@quicktvui/qtx/plugin/webpack.cjs')],
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
把 `package.json` 的两条脚本加上 `-c`:
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
"dev": "qt-dev android -c scripts/qtx-webpack.config.js",
|
|
106
|
+
"build:android": "qt-build android -c scripts/qtx-webpack.config.js"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
自建 Vite 工程不需要上面两个文件,在 `vite.config.ts` 里加一行即可:
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
import { qtx } from '@quicktvui/qtx/plugin/vite.mjs'
|
|
113
|
+
export default defineConfig({ plugins: [vue(), qtx()] })
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
页面写法只有两条:不写裁切属性 = 不裁;写 `overflow="hidden"` 并用 `:width` / `:height` 显式声明尺寸 = 裁。自检:构建产物中页面层 `div` 应带 `:clipChildren="false"`,写 `overflow: hidden` 的容器应带 `:clipBounds`;没有就说明插件没挂上。
|
|
117
|
+
|
|
80
118
|
## 3. 完整工程(可逐字复制)
|
|
81
119
|
|
|
82
120
|
目录结构:
|
|
@@ -440,7 +478,7 @@ export default defineComponent({
|
|
|
440
478
|
| 写法 | 判定 | 依据 |
|
|
441
479
|
| --- | --- | --- |
|
|
442
480
|
| 用 `createApp(App)` + `vue-router` 搭工程 | 错误 | 宿主使用 `createESApp` + `createESRouter`,见 `src/main.ts` |
|
|
443
|
-
| `npm i @quicktvui/qtx` 不带版本 | 不推荐 |
|
|
481
|
+
| `npm i @quicktvui/qtx` 不带版本 | 不推荐 | 等于 `@latest`,不随 `--tag alpha` 发布更新;改用 `@alpha` |
|
|
444
482
|
| 示例里 `:items="rows"` 但 `rows` 未定义 | 错误 | `rows` 必须是 `setup()` 中定义并返回的响应式数组 |
|
|
445
483
|
| 依据 `qt-list-view` 文档给 `qtx-list` 传属性 | 错误 | 平台资料不含 `qtx-*` 定义,参数查组件生成页 |
|
|
446
484
|
| 认为 `div` 完全禁用 | 错误 | 平台允许 `div` / `span` 容器,禁用的是标准 HTML 语义标签 |
|
|
@@ -450,7 +488,7 @@ export default defineComponent({
|
|
|
450
488
|
|
|
451
489
|
## 6. 验收清单
|
|
452
490
|
|
|
453
|
-
- [ ] `yarn install` 与 `npm i @quicktvui/qtx@
|
|
491
|
+
- [ ] `yarn install` 与 `npm i @quicktvui/qtx@alpha` 均成功,宿主依赖版本满足 `peerDependencies`。
|
|
454
492
|
- [ ] `quicktvui-ai doctor` / `setup-vue-env` / `setup-android-env` 通过,`adb devices` 能看到目标。
|
|
455
493
|
- [ ] `run-dev` 到达 launcher 后已发送确认键,runtime 状态或日志显示 bundle 已加载。
|
|
456
494
|
- [ ] 首页渲染 6 行数据,遥控器上下左右能移动焦点,首屏存在一个自动获焦节点。
|
|
@@ -460,7 +498,7 @@ export default defineComponent({
|
|
|
460
498
|
|
|
461
499
|
## 7. 版本与资料边界
|
|
462
500
|
|
|
463
|
-
-
|
|
501
|
+
- 当前发布渠道 `alpha`;具体版本见包内 `package.json` 与发布说明。包内 `README.md` 内联了 alpha 摘要。**源码仓库为私有维护仓库,不对外公开,接入方无需访问**。
|
|
464
502
|
- 本包 `files` 只含 `dist`、`README.md` 与 `AI_CONTRACT.md`;`docs-site/`、`AGENTS.md`、`.docs/` 均不随包分发,文档站暂无在线部署地址。
|
|
465
503
|
- `docs/qtx-list-guide.md`、`docs/qtx-tabs-guide.md`、`docs/ai-guide/README.md` 与 `docs/components/*.md` 均为历史归档或占位产物,**不得**用于推断属性名与事件名。
|
|
466
504
|
- 需要 `qtx-*` 参数时以本包 `dist` 内的类型声明为准;需要平台 `qt-*` 参数时查平台官网或 `@quicktvui/ai` 的 `.docs`。
|
package/README.md
CHANGED
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
QuickTVUI 官方扩展库:Vue 3 侧的 `qtx-*` 原生高性能组件封装,原生能力由 QuickTVUI 平台运行时提供。
|
|
6
6
|
|
|
7
|
-
>
|
|
7
|
+
> 用 qtx 开发 TV 应用所需的组件、页面与设计规范
|
|
8
8
|
|
|
9
|
-
> 当前版本 **`0.9.0-alpha.
|
|
9
|
+
> 当前版本 **`0.9.0-alpha.3`**(0.9 预发布阶段):用于第三方在真实 TV 场景试用并反馈。**本阶段允许破坏性变更,不承诺向下兼容**;先用一个真实项目完整验证后再发 `1.0.0`。
|
|
10
10
|
|
|
11
11
|
> **给 AI / 接入方**:先读同包内 `AI_CONTRACT.md`(《给 AI 的接入契约》)。它给出宿主依赖、真实脚手架命令、完整 `main.ts` + `App.vue` + 双页路由示例与装机链路;仅凭包内两份 md 可完成 qtx 接入与最小双页应用,平台原生 `qt-*` 组件 / 播放器 / 高级路由能力仍需读平台资料(见下)。qtx 是 **QuickTVUI 平台之上的扩展库**:渲染器、焦点、按键、路由、生命周期与播放器由平台提供,平台前置资料(项目根 `AGENTS.md` 与 `node_modules/@quicktvui/ai/rules/.docs/`)由平台模板项目提供,**不随本 npm 包分发**。
|
|
12
12
|
|
|
13
13
|
## 安装
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm i @quicktvui/qtx@
|
|
16
|
+
npm i @quicktvui/qtx@alpha
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
`@alpha` 跟随 alpha 渠道最新发布;`npm i @quicktvui/qtx` 等于 `@latest`,不会随 `--tag alpha` 发布更新,可能拿到滞后版本。需要可复现构建时锁定具体版本号。`0.y.z` 阶段允许破坏性变更。
|
|
20
20
|
|
|
21
21
|
| 依赖 | 版本 / 坐标 | 说明 |
|
|
22
22
|
| --- | --- | --- |
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { QtxFileMethods } from './file';
|
|
2
|
+
/** qtx.file 命名空间(懒引导 + 直连原生) */
|
|
3
|
+
export declare const file: import("../core/capabilities").QtxCapabilityReservedMethods & QtxFileMethods;
|
|
4
|
+
/** qtx.file 事件名常量(EventBus 订阅用) */
|
|
5
|
+
export declare const QTX_FILE_EVENTS: {
|
|
6
|
+
/** USB / 存储卷热插拔(系统广播监听,引擎销毁注销);payload:{ volume: QtxFileVolume, action: 'mounted'|'unmounted', timestamp: number }(volume 结构同 getVolumes;REMOVED/BAD_REMOVAL/EJECT 映射为 unmounted) */
|
|
7
|
+
readonly volumeChanged: "onQtxVolumeChanged";
|
|
8
|
+
/** copy/move 任务进度与终态(协议 §5『完整文件传输进度走事件』;payload 必带 taskId);payload:{ taskId: string, op: 'copy'|'move', state: 'running'|'done'|'error'|'cancelled', src: string, dst: string, bytesDone: number, bytesTotal: number, speedBps: number, elapsedMs?: number, durationMs?: number, fastPath?: boolean, error?: {code, message} }(running 节流 ≥150ms 且 ≥2%;speedBps 原生计算 JS 不再除时间;fastPath=true 为同卷 move rename 快路径) */
|
|
9
|
+
readonly task: "onQtxFileTask";
|
|
10
|
+
};
|
|
@@ -11,6 +11,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
11
11
|
paddingBottom?: any;
|
|
12
12
|
reverseLayout?: boolean | undefined;
|
|
13
13
|
iconPosition?: string | undefined;
|
|
14
|
+
itemPadding?: any;
|
|
15
|
+
iconMargin?: any;
|
|
16
|
+
focusedKey?: string | undefined;
|
|
14
17
|
gravity?: string | undefined;
|
|
15
18
|
align?: string | undefined;
|
|
16
19
|
crossAlign?: string | undefined;
|
|
@@ -73,6 +76,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
73
76
|
paddingBottom?: any;
|
|
74
77
|
reverseLayout?: boolean | undefined;
|
|
75
78
|
iconPosition?: string | undefined;
|
|
79
|
+
itemPadding?: any;
|
|
80
|
+
iconMargin?: any;
|
|
81
|
+
focusedKey?: string | undefined;
|
|
76
82
|
gravity?: string | undefined;
|
|
77
83
|
align?: string | undefined;
|
|
78
84
|
crossAlign?: string | undefined;
|
|
@@ -32,6 +32,12 @@ export interface QtxChannelNavProps {
|
|
|
32
32
|
itemHeight?: number;
|
|
33
33
|
/** 项间距(px),默认 12 */
|
|
34
34
|
gap?: number;
|
|
35
|
+
/** 频道项内容区内边距(px),四边统一;避免图标/文字贴着 item 边缘,默认 16 */
|
|
36
|
+
itemPadding?: number;
|
|
37
|
+
/** 图标与频道文字之间的间距(px),随 iconPosition 作用于对应方向,默认 12 */
|
|
38
|
+
iconMargin?: number;
|
|
39
|
+
/** 受控焦点频道 key;ES 把方向键派发给页面 onKeyDown,由上层回写此属性驱动焦点态 */
|
|
40
|
+
focusedKey?: string;
|
|
35
41
|
/** 栏内左内边距(px),默认 0 */
|
|
36
42
|
paddingLeft?: number;
|
|
37
43
|
/** 栏内上内边距(px),默认 0 */
|
|
@@ -182,6 +188,10 @@ export interface QtxChannelNavState {
|
|
|
182
188
|
itemWidth: number;
|
|
183
189
|
/** 单项高度 */
|
|
184
190
|
itemHeight: number;
|
|
191
|
+
/** 频道项内容区内边距 */
|
|
192
|
+
itemPadding: number;
|
|
193
|
+
/** 图标与文字间距 */
|
|
194
|
+
iconMargin: number;
|
|
185
195
|
/** 当前主轴对齐方式 */
|
|
186
196
|
align: string;
|
|
187
197
|
/** 当前交叉轴对齐方式 */
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/** qtx 统一(主)插件包名 */
|
|
2
|
+
export declare const QTX_PLUGIN_PKG = "com.quicktvui.plugin.qtx";
|
|
3
|
+
/** 插件入口类(宿主 callReflect 调用其 setup());能力域按 `${pkg}.QtxPluginApp` 同一约定派生 */
|
|
4
|
+
export declare const QTX_PLUGIN_INIT_CLASS = "com.quicktvui.plugin.qtx.QtxPluginApp";
|
|
5
|
+
/** JS 侧要求的最低指令协议版本(与 GridTabsSDUI.md 同步;仅 core 分支校验,协议 §3) */
|
|
6
|
+
export declare const QTX_MIN_PROTOCOL_VERSION = "1.28.0";
|
|
7
|
+
/**
|
|
8
|
+
* 能力域描述。能力域(qtx.file 等)由 qtx-cli generate 按
|
|
9
|
+
* android/qtx-<name>/capability.json 写入注册表(minVersion 与类型同源,禁止手改);
|
|
10
|
+
* 主插件同轨域(core + dogfood 四模块)为内建手写条目。
|
|
11
|
+
*/
|
|
12
|
+
export interface QtxCapabilitySpec {
|
|
13
|
+
/** JS 命名空间段,如 'file';子域用点号,如 'config.gridTabs' */
|
|
14
|
+
ns: string;
|
|
15
|
+
/** 插件 APK 包名,如 'com.quicktvui.plugin.qtx.file' */
|
|
16
|
+
pkg: string;
|
|
17
|
+
/** 原生主模块名(Proxy 方法直连目标),如 'QtxFileModule' */
|
|
18
|
+
module: string;
|
|
19
|
+
/** 原生版本模块名(就绪探测 + 版本协商),如 'QtxFileVersionModule' */
|
|
20
|
+
versionModule: string;
|
|
21
|
+
/** JS 侧要求的最低插件版本(域轨 semver);空串 = 随主插件轨(编译期注入) */
|
|
22
|
+
minVersion: string;
|
|
23
|
+
/** 可选子模块(ns 内多模块分发时登记,供诊断与文档) */
|
|
24
|
+
subModules?: Record<string, string>;
|
|
25
|
+
}
|
|
26
|
+
/** 能力域版本信息(各域版本模块 getVersionInfo 的返回;core 分支另含 protocolVersion/components) */
|
|
27
|
+
export interface QtxCapabilityVersionInfo {
|
|
28
|
+
pluginVersion: string;
|
|
29
|
+
/** 仅主插件轨返回 */
|
|
30
|
+
protocolVersion?: string;
|
|
31
|
+
/** 仅主插件轨返回 */
|
|
32
|
+
components?: Record<string, string>;
|
|
33
|
+
mode: 'plugin' | 'embedded';
|
|
34
|
+
}
|
|
35
|
+
/** ensureCapability 选项(installQtx 的 InstallQtxOptions 在 core 包装层映射到此) */
|
|
36
|
+
export interface EnsureCapabilityOptions {
|
|
37
|
+
/** 覆盖注册表 minVersion 的最低插件版本 */
|
|
38
|
+
minVersion?: string;
|
|
39
|
+
/** 仅 core:兼容的最低指令协议版本 */
|
|
40
|
+
minProtocolVersion?: string;
|
|
41
|
+
/** auto=缺失/过期时驱动宿主插件管理器下载安装;manual=只报错不动作 */
|
|
42
|
+
upgrade?: 'auto' | 'manual';
|
|
43
|
+
/** 单次安装超时(毫秒),默认 8000 */
|
|
44
|
+
timeout?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 引导层错误。`capability` 标明哪个命名空间的引导失败(core 向后兼容:默认 'core'),
|
|
48
|
+
* 错误信息指明插件包名与两侧版本号(协议 §4.3)。
|
|
49
|
+
*/
|
|
50
|
+
export declare class QtxInstallError extends Error {
|
|
51
|
+
code: 'PROBE_FAILED' | 'INSTALL_FAILED' | 'VERSION_TOO_LOW' | 'PROTOCOL_MISMATCH' | 'TIMEOUT' | 'UNKNOWN_CAPABILITY';
|
|
52
|
+
capability: string;
|
|
53
|
+
detail?: Partial<QtxCapabilityVersionInfo> & {
|
|
54
|
+
minPluginVersion?: string;
|
|
55
|
+
minProtocolVersion?: string;
|
|
56
|
+
};
|
|
57
|
+
constructor(code: QtxInstallError['code'], message: string, detail?: QtxInstallError['detail'], capability?: string);
|
|
58
|
+
}
|
|
59
|
+
/** 协议 §2 保留命名空间:主插件自身模块与列表族命令式 API 专用,能力域不得占用 */
|
|
60
|
+
export declare const RESERVED_NAMESPACE_ROOTS: readonly string[];
|
|
61
|
+
/** 宽松 semver 比较(actual >= required) */
|
|
62
|
+
export declare function isVersionAtLeast(actual: string, required: string): boolean;
|
|
63
|
+
/** 能力注册表(只读视图;内建条目 + generate 产出的能力域条目) */
|
|
64
|
+
export declare const CAPABILITIES: ReadonlyMap<string, QtxCapabilitySpec>;
|
|
65
|
+
/**
|
|
66
|
+
* 注册能力域(qtx-cli generate 产物的入口;也可用于宿主侧扩展)。
|
|
67
|
+
* 校验:ns 格式合法、根段不占用保留命名空间、字段齐全、minVersion 为字面量(与类型同源)。
|
|
68
|
+
*/
|
|
69
|
+
export declare function registerCapability(spec: QtxCapabilitySpec): QtxCapabilitySpec;
|
|
70
|
+
/** 取能力域 spec(不存在返回 null) */
|
|
71
|
+
export declare function getCapabilitySpec(ns: string): QtxCapabilitySpec | null;
|
|
72
|
+
/**
|
|
73
|
+
* 引导某能力域(幂等单例,可重试——失败后再次调用会重新走流程)。
|
|
74
|
+
* `qtx.<ns>.*` 首调自动触发;一般无需手动调用。
|
|
75
|
+
*/
|
|
76
|
+
export declare function ensureCapability(ns: string, options?: EnsureCapabilityOptions): Promise<QtxCapabilityVersionInfo>;
|
|
77
|
+
/** 当前就绪状态快照(同步,不触发引导) */
|
|
78
|
+
export declare function getCapabilityInfo(ns: string): QtxCapabilityVersionInfo | null;
|
|
79
|
+
/** 命名空间保留字(Proxy 特判,不透传原生) */
|
|
80
|
+
export interface QtxCapabilityReservedMethods {
|
|
81
|
+
/** 触发(或等待)引导完成,返回版本信息 */
|
|
82
|
+
ready(): Promise<QtxCapabilityVersionInfo>;
|
|
83
|
+
/** 只触发引导(预热),完成即返回 */
|
|
84
|
+
preheat(): Promise<void>;
|
|
85
|
+
/** 当前就绪信息快照(同步,未就绪为 null,不触发引导) */
|
|
86
|
+
getInfo(): QtxCapabilityVersionInfo | null;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* 定义能力命名空间代理:`qtx.<ns>.<method>(...)` → `await ensureCapability(ns)` →
|
|
90
|
+
* `callNativeWithPromise(spec.module, method, ...args)`。保留字特判;thenable / JSON
|
|
91
|
+
* 序列化安全。方法函数按属性名缓存(同名取回同引用)。
|
|
92
|
+
*/
|
|
93
|
+
export declare function defineCapability<M extends object = Record<string, (...args: any[]) => any>>(ns: string): QtxCapabilityReservedMethods & M;
|
|
94
|
+
/** qtx.version 方法面(主插件版本信息,只读诊断) */
|
|
95
|
+
export interface QtxVersionMethods {
|
|
96
|
+
/** 获取插件 / 内嵌版本信息(pluginVersion / protocolVersion / components / mode) */
|
|
97
|
+
getVersionInfo(): Promise<QtxCapabilityVersionInfo>;
|
|
98
|
+
}
|
|
99
|
+
/** qtx.env 方法面(宿主内建模块清单,只读诊断) */
|
|
100
|
+
export interface QtxEnvMethods {
|
|
101
|
+
/** 获取宿主内建(embedded)模块版本清单:模块名 → 版本串 */
|
|
102
|
+
getBuiltInVersions(): Promise<Record<string, string>>;
|
|
103
|
+
}
|
|
104
|
+
/** qtx.config.gridTabs 方法面(GridTabs 全局兜底配置) */
|
|
105
|
+
export interface QtxConfigGridTabsMethods {
|
|
106
|
+
/** 设置全局兜底配置(themeConfig / loadingConfig 等;对象入参自动按 JSON 字符串过桥) */
|
|
107
|
+
setDefaultConfig(config: Record<string, any> | string): Promise<any>;
|
|
108
|
+
}
|
|
109
|
+
/** qtx.config.extraUI 方法面(ExtraUI 全局主题) */
|
|
110
|
+
export interface QtxConfigExtraUIMethods {
|
|
111
|
+
/** 设置全局主题(primaryColor / focusBorderColor / cornerRadius 等;对象入参自动按 JSON 字符串过桥) */
|
|
112
|
+
setThemeConfig(theme: Record<string, any> | string): Promise<any>;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* 把注册表中的命名空间挂到目标对象(qtx 默认导出):已手写挂载的根跳过(dogfood 带
|
|
116
|
+
* 完整类型),其余(未来 generate 产出的能力域,如 qtx.file)逐 ns 懒挂载。
|
|
117
|
+
* core 不挂方法面(主插件引导走 installQtx(),qtx.core 保留给框架自身)。
|
|
118
|
+
*/
|
|
119
|
+
export declare function attachCapabilityNamespaces(target: Record<string, any>): void;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
/** qtx 统一插件 */
|
|
2
1
|
export declare const QTX_PLUGIN_PKG = "com.quicktvui.plugin.qtx";
|
|
3
|
-
/** 插件入口类(宿主 callReflect 调用其 setup()) */
|
|
4
2
|
export declare const QTX_PLUGIN_INIT_CLASS = "com.quicktvui.plugin.qtx.QtxPluginApp";
|
|
5
|
-
/** JS 侧要求的最低指令协议版本(与 GridTabsSDUI.md 同步) */
|
|
6
3
|
export declare const QTX_MIN_PROTOCOL_VERSION = "1.28.0";
|
|
7
4
|
export interface QtxVersionInfo {
|
|
8
5
|
pluginVersion: string;
|
|
@@ -20,14 +17,7 @@ export interface InstallQtxOptions {
|
|
|
20
17
|
/** 单次安装超时(毫秒),默认 8000 */
|
|
21
18
|
timeout?: number;
|
|
22
19
|
}
|
|
23
|
-
export
|
|
24
|
-
code: 'PROBE_FAILED' | 'INSTALL_FAILED' | 'VERSION_TOO_LOW' | 'PROTOCOL_MISMATCH' | 'TIMEOUT';
|
|
25
|
-
detail?: Partial<QtxVersionInfo> & {
|
|
26
|
-
minPluginVersion?: string;
|
|
27
|
-
minProtocolVersion?: string;
|
|
28
|
-
};
|
|
29
|
-
constructor(code: QtxInstallError['code'], message: string, detail?: QtxInstallError['detail']);
|
|
30
|
-
}
|
|
20
|
+
export { QtxInstallError } from './capabilities';
|
|
31
21
|
export declare function isVersionAtLeast(actual: string, required: string): boolean;
|
|
32
22
|
/**
|
|
33
23
|
* 引导 qtx(全局单例,幂等,可重试——失败后再次调用会重新走流程)。
|
package/dist/core/theme.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 全局主题初始化(自旧 AddonProvider 迁出的纯函数部分,shade/env 逻辑已退役)。
|
|
3
|
-
*/
|
|
4
|
-
/** 初始化 GridTabs 的全局兜底配置(themeConfig / loadingConfig 等) */
|
|
1
|
+
/** 初始化 GridTabs 的全局兜底配置(themeConfig / loadingConfig 等);等价 qtx.config.gridTabs.setDefaultConfig */
|
|
5
2
|
export declare function initGridTabsGlobalConfig(config: Record<string, any>): Promise<boolean>;
|
|
6
|
-
/** 初始化 ExtraUI 的全局主题(primaryColor、focusBorderColor、cornerRadius
|
|
3
|
+
/** 初始化 ExtraUI 的全局主题(primaryColor、focusBorderColor、cornerRadius 等);等价 qtx.config.extraUI.setThemeConfig */
|
|
7
4
|
export declare function initExtraUIGlobalTheme(config: Record<string, any>): Promise<boolean>;
|
|
8
5
|
/**
|
|
9
6
|
* 一键设置全局主题(联合配置):同时配置 extra-ui 与 grid-tabs/glint 的主题参数。
|
package/dist/index.d.ts
CHANGED
|
@@ -37,16 +37,32 @@ import { QtxChannelNavPlugin, QtxChannelNav } from './components/QtxChannelNav';
|
|
|
37
37
|
export { QtxGridTabsPlugin, QtxGridTabs, QtxKeyboardPlugin, QtxKeyboard, QtxNumericKeyboardPlugin, QtxNumericKeyboard, QtxPortalPoolPlugin, QtxPortalPool, QtxPortalItemPlugin, QtxPortalItem, QtxHsvBackgroundPlugin, QtxHsvBackground, QtxSvgImagePlugin, QtxSvgImage, QtxButtonPlugin, QtxButton, QtxCheckboxPlugin, QtxCheckbox, QtxRadioGroupPlugin, QtxRadioGroup, QtxCheckboxGroupPlugin, QtxCheckboxGroup, QtxSwitcherPlugin, QtxSwitcher, QtxSettingSwitchPlugin, QtxSettingSwitch, QtxCollapseMenuGroupPlugin, QtxCollapseMenuGroup, QtxCollapseMenuListPlugin, QtxCollapseMenuList, QtxInputViewPlugin, QtxInputView, QtxDatePickerPlugin, QtxDatePicker, QtxRatingBarPlugin, QtxRatingBar, QtxListPlugin, QtxList, QtxTabsPlugin, QtxTabs, QtxTabContent, QtxPosterPlugin, QtxPoster, QtxAppIconPlugin, QtxAppIcon, QtxChannelNavPlugin, QtxChannelNav };
|
|
38
38
|
export { installQtx, ensureQtxReady, getQtxReadyInfo, QtxInstallError, isVersionAtLeast } from './core/installQtx';
|
|
39
39
|
export type { QtxVersionInfo, InstallQtxOptions } from './core/installQtx';
|
|
40
|
+
export { CAPABILITIES, RESERVED_NAMESPACE_ROOTS, ensureCapability, getCapabilityInfo, getCapabilitySpec, registerCapability, defineCapability, attachCapabilityNamespaces, } from './core/capabilities';
|
|
41
|
+
export type { QtxCapabilitySpec, QtxCapabilityVersionInfo, EnsureCapabilityOptions, QtxCapabilityReservedMethods, QtxVersionMethods, QtxEnvMethods, QtxConfigGridTabsMethods, QtxConfigExtraUIMethods, } from './core/capabilities';
|
|
40
42
|
export { createQtxGate } from './core/qtxGate';
|
|
41
43
|
export { initGlobalTheme, initExtraUIGlobalTheme, initGridTabsGlobalConfig } from './core/theme';
|
|
42
44
|
export { vPortalTo } from './directives/v-portal-to';
|
|
43
45
|
export { setPortalListViewId, getPortalListViewId, registerPortalLive } from './core/portalCoordinator';
|
|
44
46
|
import { App } from 'vue';
|
|
47
|
+
import { type QtxConfigExtraUIMethods, type QtxConfigGridTabsMethods, type QtxEnvMethods, type QtxVersionMethods } from './core/capabilities';
|
|
48
|
+
import './capabilities';
|
|
45
49
|
/**
|
|
46
50
|
* qtx Vue 插件:注册全部 qtx-* 组件,并自动触发插件引导(探测/协商/安装)。
|
|
47
51
|
* 这是用户唯一需要写的一行:app.use(qtx)。
|
|
52
|
+
*
|
|
53
|
+
* 命名空间属性(version / env / config 等)是能力接入层资产,与全局组件注册互不冲突
|
|
54
|
+
* (app.use 只读取 install;组件仍走 app.component / registerElement 通道)。
|
|
48
55
|
*/
|
|
49
56
|
export declare const qtx: {
|
|
57
|
+
/** 版本与就绪信息(qtx.version.*,保留字 ready/preheat/getInfo) */
|
|
58
|
+
version: import("./core/capabilities").QtxCapabilityReservedMethods & QtxVersionMethods;
|
|
59
|
+
/** 宿主内建模块清单(qtx.env.*) */
|
|
60
|
+
env: import("./core/capabilities").QtxCapabilityReservedMethods & QtxEnvMethods;
|
|
61
|
+
/** 全局配置命名空间(qtx.config.gridTabs / qtx.config.extraUI) */
|
|
62
|
+
config: {
|
|
63
|
+
gridTabs: import("./core/capabilities").QtxCapabilityReservedMethods & QtxConfigGridTabsMethods;
|
|
64
|
+
extraUI: import("./core/capabilities").QtxCapabilityReservedMethods & QtxConfigExtraUIMethods;
|
|
65
|
+
};
|
|
50
66
|
install: (app: App) => void;
|
|
51
67
|
};
|
|
52
68
|
export default qtx;
|