@quicktvui/qtx 0.9.0-alpha.1 → 0.9.0-alpha.2

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 CHANGED
@@ -6,14 +6,14 @@ QuickTVUI 官方扩展库:Vue 3 侧的 `qtx-*` 原生高性能组件封装,
6
6
 
7
7
  > 面向整个扩展库的源码级文档,不只是某一个组件
8
8
 
9
- > 当前版本 **`0.9.0-alpha.1`**(0.9 预发布阶段):用于第三方在真实 TV 场景试用并反馈。**本阶段允许破坏性变更,不承诺向下兼容**;先用一个真实项目完整验证后再发 `1.0.0`。
9
+ > 当前版本 **`0.9.0-alpha.2`**(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@0.9.0-alpha.1
16
+ npm i @quicktvui/qtx@0.9.0-alpha.2
17
17
  ```
18
18
 
19
19
  不要省略版本号:alpha 包只以 npm dist-tag `alpha` 分发,不设 `latest`;`0.y.z` 阶段允许破坏性变更。
@@ -80,14 +80,15 @@ export default defineComponent({
80
80
  - `<qtx-button>` 的确认动作用 `@click`(Vue attrs 透传到原生 onClick,真机 demo 已使用);生成 API 表登记的 `@onButtonCustomEvent` 是另一条自定义事件通道。其他 `qtx-*` 组件按各自生成页的事件表接线。
81
81
  - 宿主运行时未就绪时组件显示占位,就绪后自动渲染;业务代码无需参与原生能力的装载与兼容判断。
82
82
 
83
- ## 组件清单(21)
83
+ ## 组件清单(22)
84
84
 
85
85
  由 `js/qtx/src/index.ts` 的导出清单生成,不是手写清单;仅列出对外公开的组件。
86
86
 
87
- ### 原生桥接组件(17)
87
+ ### 原生桥接组件(18)
88
88
 
89
89
  - `<qtx-app-icon>` 应用图标卡片
90
90
  - `<qtx-button>` 按钮
91
+ - `<qtx-channel-nav>` 频道导航
91
92
  - `<qtx-checkbox>` 复选框
92
93
  - `<qtx-collapse-menu-group>` 折叠菜单分组
93
94
  - `<qtx-collapse-menu-list>` 折叠菜单列表
@@ -0,0 +1,48 @@
1
+ import type { QtxChannelNavProps, QtxChannelNavState, QtxChannelNavItem, QtxChannelNavEventPayload, QtxChannelNavScrollPayload } from './types';
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<QtxChannelNavProps>>, {
3
+ getNativeNode(): any;
4
+ setActive(key: string): void;
5
+ getActiveKey(): Promise<string>;
6
+ getFocusedKey(): Promise<string>;
7
+ requestFocus(): Promise<string>;
8
+ clearFocus(): Promise<string>;
9
+ getState(): Promise<QtxChannelNavState>;
10
+ scrollToKey(key: string): Promise<string>;
11
+ updateItems(items: QtxChannelNavItem[]): Promise<string>;
12
+ setOrientation(orientation: string): Promise<string>;
13
+ setStyle(tokens: Partial<QtxChannelNavProps>): Promise<string>;
14
+ getItemCount(): Promise<number>;
15
+ getItemAt(index: number): Promise<QtxChannelNavItem>;
16
+ getScrollState(): Promise<QtxChannelNavState>;
17
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ change: (key: string, payload: QtxChannelNavEventPayload) => void;
19
+ "update:active": (key: string) => void;
20
+ focus: (key: string, payload: QtxChannelNavEventPayload) => void;
21
+ blur: (key: string, payload: QtxChannelNavEventPayload) => void;
22
+ longClick: (key: string, payload: QtxChannelNavEventPayload) => void;
23
+ scroll: (payload: QtxChannelNavScrollPayload) => void;
24
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<QtxChannelNavProps>>> & Readonly<{
25
+ onBlur?: ((key: string, payload: QtxChannelNavEventPayload) => any) | undefined;
26
+ onChange?: ((key: string, payload: QtxChannelNavEventPayload) => any) | undefined;
27
+ onFocus?: ((key: string, payload: QtxChannelNavEventPayload) => any) | undefined;
28
+ onScroll?: ((payload: QtxChannelNavScrollPayload) => any) | undefined;
29
+ "onUpdate:active"?: ((key: string) => any) | undefined;
30
+ onLongClick?: ((key: string, payload: QtxChannelNavEventPayload) => any) | undefined;
31
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
32
+ default?(_: {}): any;
33
+ }>;
34
+ export default _default;
35
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
36
+ type __VLS_TypePropsToRuntimeProps<T> = {
37
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
38
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
39
+ } : {
40
+ type: import('vue').PropType<T[K]>;
41
+ required: true;
42
+ };
43
+ };
44
+ type __VLS_WithTemplateSlots<T, S> = T & {
45
+ new (): {
46
+ $slots: S;
47
+ };
48
+ };
@@ -0,0 +1,127 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
2
+ items?: any;
3
+ active?: string | undefined;
4
+ orientation?: string | undefined;
5
+ itemWidth?: any;
6
+ itemHeight?: any;
7
+ gap?: any;
8
+ paddingLeft?: any;
9
+ paddingTop?: any;
10
+ paddingRight?: any;
11
+ paddingBottom?: any;
12
+ reverseLayout?: boolean | undefined;
13
+ iconPosition?: string | undefined;
14
+ gravity?: string | undefined;
15
+ align?: string | undefined;
16
+ crossAlign?: string | undefined;
17
+ fontSize?: any;
18
+ borderRadius?: any;
19
+ iconSize?: any;
20
+ focusBorderWidth?: any;
21
+ normalBg?: string | undefined;
22
+ normalText?: string | undefined;
23
+ focusBg?: string | undefined;
24
+ focusText?: string | undefined;
25
+ focusBorderColor?: string | undefined;
26
+ selectedBg?: string | undefined;
27
+ selectedText?: string | undefined;
28
+ disabledBg?: string | undefined;
29
+ disabledText?: string | undefined;
30
+ indicator?: string | undefined;
31
+ indicatorColor?: string | undefined;
32
+ indicatorSize?: any;
33
+ badgeBg?: string | undefined;
34
+ badgeText?: string | undefined;
35
+ scrollMode?: string | undefined;
36
+ smoothScroll?: boolean | undefined;
37
+ focusable?: boolean | undefined;
38
+ selectOnFocus?: boolean | undefined;
39
+ focusMemory?: boolean | undefined;
40
+ defaultFocusKey?: string | undefined;
41
+ maxPoolSize?: any;
42
+ }>>, {
43
+ getNativeNode: () => any;
44
+ setActive: (...args: any[]) => void;
45
+ getActiveKey: (...args: any[]) => void;
46
+ getFocusedKey: (...args: any[]) => void;
47
+ requestFocus: (...args: any[]) => void;
48
+ clearFocus: (...args: any[]) => void;
49
+ getState: (...args: any[]) => void;
50
+ scrollToKey: (...args: any[]) => void;
51
+ updateItems: (...args: any[]) => void;
52
+ setOrientation: (...args: any[]) => void;
53
+ setStyle: (...args: any[]) => void;
54
+ getItemCount: (...args: any[]) => void;
55
+ getItemAt: (...args: any[]) => void;
56
+ getScrollState: (...args: any[]) => void;
57
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
58
+ onChange: (payload?: any) => void;
59
+ onFocus: (payload?: any) => void;
60
+ onBlur: (payload?: any) => void;
61
+ onLongClick: (payload?: any) => void;
62
+ onScroll: (payload?: any) => void;
63
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
64
+ items?: any;
65
+ active?: string | undefined;
66
+ orientation?: string | undefined;
67
+ itemWidth?: any;
68
+ itemHeight?: any;
69
+ gap?: any;
70
+ paddingLeft?: any;
71
+ paddingTop?: any;
72
+ paddingRight?: any;
73
+ paddingBottom?: any;
74
+ reverseLayout?: boolean | undefined;
75
+ iconPosition?: string | undefined;
76
+ gravity?: string | undefined;
77
+ align?: string | undefined;
78
+ crossAlign?: string | undefined;
79
+ fontSize?: any;
80
+ borderRadius?: any;
81
+ iconSize?: any;
82
+ focusBorderWidth?: any;
83
+ normalBg?: string | undefined;
84
+ normalText?: string | undefined;
85
+ focusBg?: string | undefined;
86
+ focusText?: string | undefined;
87
+ focusBorderColor?: string | undefined;
88
+ selectedBg?: string | undefined;
89
+ selectedText?: string | undefined;
90
+ disabledBg?: string | undefined;
91
+ disabledText?: string | undefined;
92
+ indicator?: string | undefined;
93
+ indicatorColor?: string | undefined;
94
+ indicatorSize?: any;
95
+ badgeBg?: string | undefined;
96
+ badgeText?: string | undefined;
97
+ scrollMode?: string | undefined;
98
+ smoothScroll?: boolean | undefined;
99
+ focusable?: boolean | undefined;
100
+ selectOnFocus?: boolean | undefined;
101
+ focusMemory?: boolean | undefined;
102
+ defaultFocusKey?: string | undefined;
103
+ maxPoolSize?: any;
104
+ }>>> & Readonly<{
105
+ onOnBlur?: ((payload?: any) => any) | undefined;
106
+ onOnChange?: ((payload?: any) => any) | undefined;
107
+ onOnFocus?: ((payload?: any) => any) | undefined;
108
+ onOnScroll?: ((payload?: any) => any) | undefined;
109
+ onOnLongClick?: ((payload?: any) => any) | undefined;
110
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
111
+ default?(_: {}): any;
112
+ }>;
113
+ export default _default;
114
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
115
+ type __VLS_TypePropsToRuntimeProps<T> = {
116
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
117
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
118
+ } : {
119
+ type: import('vue').PropType<T[K]>;
120
+ required: true;
121
+ };
122
+ };
123
+ type __VLS_WithTemplateSlots<T, S> = T & {
124
+ new (): {
125
+ $slots: S;
126
+ };
127
+ };
@@ -0,0 +1,13 @@
1
+ import type { App } from 'vue';
2
+ import QtxChannelNav from './QtxChannelNav.vue';
3
+ export declare const QtxChannelNavPlugin: {
4
+ install: (app: App) => void;
5
+ };
6
+ export { QtxChannelNav };
7
+ export default QtxChannelNavPlugin;
8
+ declare module 'vue' {
9
+ interface GlobalComponents {
10
+ QtxChannelNav: typeof QtxChannelNav;
11
+ 'qtx-channel-nav': typeof QtxChannelNav;
12
+ }
13
+ }
@@ -0,0 +1,232 @@
1
+ /**
2
+ * @description 频道导航的单项数据。items 数组顺序即遥控器遍历顺序。
3
+ */
4
+ export interface QtxChannelNavItem {
5
+ /** 唯一标识,与 qtx-tabs 的 tabKey / active 同源 */
6
+ key: string;
7
+ /** 频道名 */
8
+ label: string;
9
+ /** 可选图标地址,走站内 SVG 加载通道;省略时只显示文字 */
10
+ icon?: string;
11
+ /** 可选角标文本,如数字或「新」;省略时不显示 */
12
+ badge?: string;
13
+ /** 业务透传数据,原样随 change / focus / longClick 事件回传 */
14
+ payload?: any;
15
+ /** 禁用项:不可获焦、不可点击、视觉灰化 */
16
+ disabled?: boolean;
17
+ }
18
+ /**
19
+ * @description 频道导航组件属性。渲染、复用、三态与焦点滚动全部由 native RecyclerView 完成;
20
+ * 所有视觉与行为 token 均有默认值,最简用法只需 items / active / @change。
21
+ */
22
+ export interface QtxChannelNavProps {
23
+ /** 频道数据,默认 [];数组顺序即遥控器遍历顺序 */
24
+ items?: QtxChannelNavItem[];
25
+ /** 当前选中频道 key,默认 '';受控属性,组件不自行修改 */
26
+ active?: string;
27
+ /** 布局方向,默认 horizontal(顶部横排),vertical 为左侧竖排 */
28
+ orientation?: 'horizontal' | 'vertical' | string;
29
+ /** 单项宽度(px),默认 160 */
30
+ itemWidth?: number;
31
+ /** 单项高度(px),默认 72 */
32
+ itemHeight?: number;
33
+ /** 项间距(px),默认 12 */
34
+ gap?: number;
35
+ /** 栏内左内边距(px),默认 0 */
36
+ paddingLeft?: number;
37
+ /** 栏内上内边距(px),默认 0 */
38
+ paddingTop?: number;
39
+ /** 栏内右内边距(px),默认 0 */
40
+ paddingRight?: number;
41
+ /** 栏内下内边距(px),默认 0 */
42
+ paddingBottom?: number;
43
+ /** 反转排列方向:横排从右往左、竖排从下往上,默认 false */
44
+ reverseLayout?: boolean;
45
+ /** 图标相对文字的位置 left / top / right / bottom,默认 left */
46
+ iconPosition?: 'left' | 'top' | 'right' | 'bottom' | string;
47
+ /** 频道文字项内对齐 start / center / end,默认 center(只作用于项内文字,不移动频道序列) */
48
+ gravity?: 'start' | 'center' | 'end' | string;
49
+ /** 频道序列在整栏内的主轴对齐;横排=水平轴、竖排=垂直轴,默认 start */
50
+ align?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly' | string;
51
+ /** 频道项在整栏内的交叉轴对齐;横排=垂直轴、竖排=水平轴,默认 start */
52
+ crossAlign?: 'start' | 'center' | 'end' | string;
53
+ /** 整栏宽度(px);显式声明可避免宿主布局把容器压成 0,也是 align 计算的基准 */
54
+ width?: number | string;
55
+ /** 整栏高度(px);显式声明可避免宿主布局把容器压成 0,也是 crossAlign 计算的基准 */
56
+ height?: number | string;
57
+ /** 频道文字字号(px),默认 28 */
58
+ fontSize?: number;
59
+ /** 单项圆角(px),默认 36 */
60
+ borderRadius?: number;
61
+ /** 图标尺寸(px),默认 32;设为 0 隐藏图标 */
62
+ iconSize?: number;
63
+ /** 焦点描边宽度(px),默认 3;设为 0 关闭描边 */
64
+ focusBorderWidth?: number;
65
+ /** 普通态底色,默认 #1B2530 */
66
+ normalBg?: string;
67
+ /** 普通态文字色,默认 #A9B8C7 */
68
+ normalText?: string;
69
+ /** 未选中项获焦时的底色,默认 #33465A */
70
+ focusBg?: string;
71
+ /** 获焦态文字色,默认 #FFFFFF */
72
+ focusText?: string;
73
+ /** 焦点描边颜色,默认 #FFFFFF;描边与选中底色正交叠加 */
74
+ focusBorderColor?: string;
75
+ /** 选中态底色,默认 #FF7A1A */
76
+ selectedBg?: string;
77
+ /** 选中态文字色,默认 #FFFFFF */
78
+ selectedText?: string;
79
+ /** 禁用项底色,默认 #141A22 */
80
+ disabledBg?: string;
81
+ /** 禁用项文字色,默认 #5A6675 */
82
+ disabledText?: string;
83
+ /** 选中指示器 none / underline / bar,默认 none */
84
+ indicator?: 'none' | 'underline' | 'bar' | string;
85
+ /** 选中指示器颜色,默认 #FFD479 */
86
+ indicatorColor?: string;
87
+ /** 选中指示器厚度(px),默认 6 */
88
+ indicatorSize?: number;
89
+ /** 角标底色,默认 #E5484D */
90
+ badgeBg?: string;
91
+ /** 角标文字色,默认 #FFFFFF */
92
+ badgeText?: string;
93
+ /** 滚动策略 center / edge / none,默认 center(焦点项自动居中) */
94
+ scrollMode?: 'center' | 'edge' | 'none' | string;
95
+ /** 命令式滚动是否使用平滑动画,默认 true */
96
+ smoothScroll?: boolean;
97
+ /** 频道项是否可获焦,默认 true;关闭后只展示不参与遥控器焦点 */
98
+ focusable?: boolean;
99
+ /** 焦点移动即切换选中频道,默认 false;开启后仍派发 change */
100
+ selectOnFocus?: boolean;
101
+ /** 数据更新后恢复之前的焦点项,默认 true,避免写操作后丢焦点 */
102
+ focusMemory?: boolean;
103
+ /** 首次进入时默认获焦的频道 key,默认 ''(回退到当前 active) */
104
+ defaultFocusKey?: string;
105
+ /** 复用池容量上限(1~128),默认 16;长列表调大可减少创建次数 */
106
+ maxPoolSize?: number;
107
+ }
108
+ /**
109
+ * @description 细粒度事件的完整载荷。事件第一个参数仍是 key 字符串,
110
+ * 便于 @change="current = $event";第二个参数才是结构化载荷。
111
+ */
112
+ export interface QtxChannelNavEventPayload {
113
+ /** 触发事件的频道 key */
114
+ key: string;
115
+ /** 频道在 items 中的位置 */
116
+ position: number;
117
+ /** 仅 change 事件携带:切换前的选中 key */
118
+ previous?: string;
119
+ /** 触发事件的频道项快照 */
120
+ item?: QtxChannelNavItem;
121
+ }
122
+ /** 滚动事件的载荷:首个可见项变化时触发 */
123
+ export interface QtxChannelNavScrollPayload {
124
+ /** 首个可见项位置 */
125
+ first: number;
126
+ /** 最后一个可见项位置 */
127
+ last: number;
128
+ }
129
+ /**
130
+ * @description 频道导航对外事件。事件首参为 key 字符串,第二参为完整载荷;
131
+ * 组件受控,change 与 update:active 只回传 key,不修改 active。
132
+ */
133
+ export interface QtxChannelNavEvents {
134
+ /** 确认某个频道时回传该频道 key 与完整载荷 */
135
+ change: (key: string, payload: QtxChannelNavEventPayload) => void;
136
+ /** v-model:active 语法糖的回传事件,载荷与 change 的 key 一致 */
137
+ 'update:active': (key: string) => void;
138
+ /** 焦点落到某个频道 */
139
+ focus: (key: string, payload: QtxChannelNavEventPayload) => void;
140
+ /** 焦点离开某个频道 */
141
+ blur: (key: string, payload: QtxChannelNavEventPayload) => void;
142
+ /** 长按某个频道 */
143
+ longClick: (key: string, payload: QtxChannelNavEventPayload) => void;
144
+ /** 首个可见项变化 */
145
+ scroll: (payload: QtxChannelNavScrollPayload) => void;
146
+ }
147
+ /** 组件对外事件名清单,供生成器抽取 API 表与下游校验使用 */
148
+ export declare const QTX_CHANNEL_NAV_EVENTS: readonly ["change", "update:active", "focus", "blur", "longClick", "scroll"];
149
+ /**
150
+ * @description getState() 返回的状态快照,可直接用于排查焦点、复用与滚动状态。
151
+ */
152
+ export interface QtxChannelNavState {
153
+ /** 当前选中频道 key */
154
+ active: string;
155
+ /** 当前获焦频道 key */
156
+ focused: string;
157
+ /** 当前布局方向 */
158
+ orientation: string;
159
+ /** 频道总数 */
160
+ count: number;
161
+ /** 数据更新代数,用于观测回收防串位 */
162
+ generation: number;
163
+ /** 当前滚动策略 */
164
+ scrollMode: string;
165
+ /** 当前图标位置 */
166
+ iconPosition: string;
167
+ /** 当前指示器形态 */
168
+ indicator: string;
169
+ /** 是否反转排列 */
170
+ reverseLayout: boolean;
171
+ /** 是否焦点即选中 */
172
+ selectOnFocus: boolean;
173
+ /** 是否焦点记忆 */
174
+ focusMemory: boolean;
175
+ /** 是否可获焦 */
176
+ focusable: boolean;
177
+ /** 是否平滑滚动 */
178
+ smoothScroll: boolean;
179
+ /** 复用池容量 */
180
+ poolSize: number;
181
+ /** 单项宽度 */
182
+ itemWidth: number;
183
+ /** 单项高度 */
184
+ itemHeight: number;
185
+ /** 当前主轴对齐方式 */
186
+ align: string;
187
+ /** 当前交叉轴对齐方式 */
188
+ crossAlign: string;
189
+ /** 首项主轴偏移(px),内容超出一屏时为 0 */
190
+ alignLeading: number;
191
+ /** 项间额外主轴间距(px),space-* 时大于 0 */
192
+ alignBetween: number;
193
+ /** 交叉轴偏移(px) */
194
+ alignCross: number;
195
+ /** 首个可见项位置 */
196
+ firstVisible?: number;
197
+ /** 最后一个可见项位置 */
198
+ lastVisible?: number;
199
+ }
200
+ /**
201
+ * @description 通过 defineExpose 暴露的命令式方法;带返回值的方法均为异步 Promise。
202
+ */
203
+ export interface QtxChannelNavExpose {
204
+ /** 取到底层原生节点,供高级场景直接调用 */
205
+ getNativeNode(): any;
206
+ /** 命令式设置选中频道,并回传 change 供上层同步受控值 */
207
+ setActive(key: string): void;
208
+ /** 读取当前选中频道 key */
209
+ getActiveKey(): Promise<string>;
210
+ /** 读取当前获焦频道 key */
211
+ getFocusedKey(): Promise<string>;
212
+ /** 把遥控器焦点请求到当前选中频道 */
213
+ requestFocus(): Promise<string>;
214
+ /** 清除频道栏焦点与焦点态 */
215
+ clearFocus(): Promise<string>;
216
+ /** 读取完整状态快照 */
217
+ getState(): Promise<QtxChannelNavState>;
218
+ /** 滚动到指定频道 key */
219
+ scrollToKey(key: string): Promise<string>;
220
+ /** 差量更新频道数据;key 序列不变时只刷新内容变化的项 */
221
+ updateItems(items: QtxChannelNavItem[]): Promise<string>;
222
+ /** 运行时切换横竖方向,内部清池并重建布局 */
223
+ setOrientation(orientation: 'horizontal' | 'vertical' | string): Promise<string>;
224
+ /** 批量覆盖视觉 token,避免逐个 prop 触发多次刷新 */
225
+ setStyle(tokens: Partial<QtxChannelNavProps>): Promise<string>;
226
+ /** 读取频道总数 */
227
+ getItemCount(): Promise<number>;
228
+ /** 按位置读取单个频道项 */
229
+ getItemAt(index: number): Promise<QtxChannelNavItem>;
230
+ /** 读取可见区间与滚动状态快照 */
231
+ getScrollState(): Promise<QtxChannelNavState>;
232
+ }
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export { useGridTabs } from './components/QtxGridTabs/useGridTabs';
3
3
  export type { QtxListItem, QtxListProps, QtxListItemEvent, QtxListLoadMoreEvent, QtxListEventName, QtxListExpose, } from './components/QtxList/types';
4
4
  export { QTX_LIST_EVENTS } from './components/QtxList/types';
5
5
  export { captureItemTemplate } from './components/QtxList/capture';
6
+ export type { QtxChannelNavItem, QtxChannelNavProps, QtxChannelNavEvents, QtxChannelNavExpose } from './components/QtxChannelNav/types';
7
+ export { QTX_CHANNEL_NAV_EVENTS } from './components/QtxChannelNav/types';
6
8
  export type { QtxPosterProps, QtxPosterExpose } from './components/QtxPoster/types';
7
9
  export type { QtxAppIconProps, QtxAppIconExpose } from './components/QtxAppIcon/types';
8
10
  export { glintStylePack, compactStylePack, presetItem, styledRows, resolvePresetViewType, registerStylePack, getStylePack, listStylePacks, listPresetViewTypes, isKnownPresetViewType, } from './preset-items';
@@ -31,7 +33,8 @@ import { QtxListPlugin, QtxList } from './components/QtxList';
31
33
  import { QtxTabsPlugin, QtxTabs, QtxTabContent } from './components/QtxTabs';
32
34
  import { QtxPosterPlugin, QtxPoster } from './components/QtxPoster';
33
35
  import { QtxAppIconPlugin, QtxAppIcon } from './components/QtxAppIcon';
34
- 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 };
36
+ import { QtxChannelNavPlugin, QtxChannelNav } from './components/QtxChannelNav';
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 };
35
38
  export { installQtx, ensureQtxReady, getQtxReadyInfo, QtxInstallError, isVersionAtLeast } from './core/installQtx';
36
39
  export type { QtxVersionInfo, InstallQtxOptions } from './core/installQtx';
37
40
  export { createQtxGate } from './core/qtxGate';
@@ -89,6 +92,8 @@ declare module '@vue/runtime-core' {
89
92
  'qtx-poster': typeof QtxPoster;
90
93
  QtxAppIcon: typeof QtxAppIcon;
91
94
  'qtx-app-icon': typeof QtxAppIcon;
95
+ QtxChannelNav: typeof QtxChannelNav;
96
+ 'qtx-channel-nav': typeof QtxChannelNav;
92
97
  QtxStyledList: typeof QtxStyledList;
93
98
  }
94
99
  }
@@ -134,6 +139,8 @@ declare module 'vue' {
134
139
  'qtx-poster': typeof QtxPoster;
135
140
  QtxAppIcon: typeof QtxAppIcon;
136
141
  'qtx-app-icon': typeof QtxAppIcon;
142
+ QtxChannelNav: typeof QtxChannelNav;
143
+ 'qtx-channel-nav': typeof QtxChannelNav;
137
144
  QtxStyledList: typeof QtxStyledList;
138
145
  }
139
146
  }