@quicktvui/naddons 1.0.0-beta.0 → 1.0.0-beta.1
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Ref, ShallowRef, ComputedRef } from 'vue';
|
|
1
2
|
export interface GTAction {
|
|
2
3
|
op: 'UPDATE_ITEM' | 'APPEND_SUB_ITEMS' | 'REMOVE_ITEM' | 'RELOAD_TABS' | 'UPDATE_TAB_STATE';
|
|
3
4
|
itemId?: string;
|
|
@@ -102,9 +103,9 @@ export interface GTItemEventPayload {
|
|
|
102
103
|
hasFocus?: boolean;
|
|
103
104
|
[key: string]: any;
|
|
104
105
|
}
|
|
105
|
-
export interface GTCallbacks {
|
|
106
|
-
onTabNeedsData?: (tabId: string, index: number, reason: string) => Promise<
|
|
107
|
-
onLoadMore?: (tabId: string, cursor: number, itemId: string) => Promise<
|
|
106
|
+
export interface GTCallbacks<I extends GTItem = GTItem> {
|
|
107
|
+
onTabNeedsData?: (tabId: string, index: number, reason: string) => Promise<I[]>;
|
|
108
|
+
onLoadMore?: (tabId: string, cursor: number, itemId: string) => Promise<I[]>;
|
|
108
109
|
onItemPresence?: (event: any) => void;
|
|
109
110
|
onTabSelected?: (event: any) => void;
|
|
110
111
|
onItemClick?: (payload: GTItemEventPayload) => void;
|
|
@@ -122,27 +123,17 @@ export interface GTCallbacks {
|
|
|
122
123
|
state: number;
|
|
123
124
|
}) => void;
|
|
124
125
|
}
|
|
125
|
-
export
|
|
126
|
-
tabsDataStr:
|
|
127
|
-
bindings:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
onLoadMore: (...args: any[]) => Promise<void>;
|
|
131
|
-
onItemPresence: (...args: any[]) => void;
|
|
132
|
-
onTabSelected: (...args: any[]) => void;
|
|
133
|
-
onItemClick: (...args: any[]) => void;
|
|
134
|
-
onItemFocused: (...args: any[]) => void;
|
|
135
|
-
onTabFocused: (...args: any[]) => void;
|
|
136
|
-
onScroll: (...args: any[]) => void;
|
|
137
|
-
onScrollStateChanged: (...args: any[]) => void;
|
|
138
|
-
}>;
|
|
139
|
-
tabs: import("vue").ShallowRef<GTTab[], GTTab[]>;
|
|
140
|
-
items: import("vue").ShallowRef<GTItem[], GTItem[]>;
|
|
126
|
+
export interface UseGridTabsReturn<T extends GTTab = GTTab, I extends GTItem = GTItem> {
|
|
127
|
+
tabsDataStr: Ref<string>;
|
|
128
|
+
bindings: ComputedRef<any>;
|
|
129
|
+
tabs: ShallowRef<T[]>;
|
|
130
|
+
items: ShallowRef<I[]>;
|
|
141
131
|
initData: (data: any[]) => void;
|
|
142
|
-
setCallbacks: (callbacks: GTCallbacks) => void;
|
|
132
|
+
setCallbacks: (callbacks: GTCallbacks<I>) => void;
|
|
143
133
|
updateItem: (itemId: string, payload: any) => void;
|
|
144
134
|
dispatchAction: (action: GTAction | GTAction[]) => void;
|
|
145
135
|
resetInitialization: () => void;
|
|
146
|
-
getFocusState: () => Promise<
|
|
147
|
-
getItemRect: (itemId: string) => Promise<
|
|
148
|
-
}
|
|
136
|
+
getFocusState: () => Promise<any>;
|
|
137
|
+
getItemRect: (itemId: string) => Promise<any>;
|
|
138
|
+
}
|
|
139
|
+
export declare function useGridTabs<T extends GTTab = GTTab, I extends GTItem = GTItem>(gridRef: any, defaultConfig?: GTConfig): UseGridTabsReturn<T, I>;
|