react-native-gesture-image-viewer 2.3.3 → 3.0.0-beta.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 +5 -3
- package/lib/module/GestureViewer.js +88 -140
- package/lib/module/GestureViewer.js.map +1 -1
- package/lib/module/GestureViewerManager.js +49 -105
- package/lib/module/GestureViewerManager.js.map +1 -1
- package/lib/module/gestureViewerAnimation.js +18 -0
- package/lib/module/gestureViewerAnimation.js.map +1 -0
- package/lib/module/gestureViewerPaging.js +66 -0
- package/lib/module/gestureViewerPaging.js.map +1 -0
- package/lib/module/gestureViewerRenderWindow.js +29 -0
- package/lib/module/gestureViewerRenderWindow.js.map +1 -0
- package/lib/module/getWebContentProps.js +6 -0
- package/lib/module/getWebContentProps.js.map +1 -0
- package/lib/module/getWebContentProps.web.js +8 -0
- package/lib/module/getWebContentProps.web.js.map +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/platformTapGestures.js +4 -0
- package/lib/module/platformTapGestures.js.map +1 -0
- package/lib/module/platformTapGestures.web.js +4 -0
- package/lib/module/platformTapGestures.web.js.map +1 -0
- package/lib/module/renderWindow.js +160 -0
- package/lib/module/renderWindow.js.map +1 -0
- package/lib/module/useGestureViewer.js +386 -200
- package/lib/module/useGestureViewer.js.map +1 -1
- package/lib/module/useGestureViewerController.js +3 -3
- package/lib/module/useGestureViewerController.js.map +1 -1
- package/lib/module/useGestureViewerManagerBridge.js +85 -0
- package/lib/module/useGestureViewerManagerBridge.js.map +1 -0
- package/lib/module/useGestureViewerPaging.js +147 -65
- package/lib/module/useGestureViewerPaging.js.map +1 -1
- package/lib/module/useWebClickHandler.js +7 -0
- package/lib/module/useWebClickHandler.js.map +1 -0
- package/lib/module/useWebClickHandler.web.js +85 -0
- package/lib/module/useWebClickHandler.web.js.map +1 -0
- package/lib/module/useWebSingleTapTimer.js +12 -0
- package/lib/module/useWebSingleTapTimer.js.map +1 -0
- package/lib/module/useWebSingleTapTimer.web.js +25 -0
- package/lib/module/useWebSingleTapTimer.web.js.map +1 -0
- package/lib/module/utils/index.js +0 -77
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/tapZoom.js +4 -3
- package/lib/module/utils/tapZoom.js.map +1 -1
- package/lib/typescript/src/GestureViewer.d.ts +1 -1
- package/lib/typescript/src/GestureViewer.d.ts.map +1 -1
- package/lib/typescript/src/GestureViewerManager.d.ts +20 -20
- package/lib/typescript/src/GestureViewerManager.d.ts.map +1 -1
- package/lib/typescript/src/gestureViewerAnimation.d.ts +15 -0
- package/lib/typescript/src/gestureViewerAnimation.d.ts.map +1 -0
- package/lib/typescript/src/gestureViewerPaging.d.ts +13 -0
- package/lib/typescript/src/gestureViewerPaging.d.ts.map +1 -0
- package/lib/typescript/src/gestureViewerRenderWindow.d.ts +15 -0
- package/lib/typescript/src/gestureViewerRenderWindow.d.ts.map +1 -0
- package/lib/typescript/src/getWebContentProps.d.ts +3 -0
- package/lib/typescript/src/getWebContentProps.d.ts.map +1 -0
- package/lib/typescript/src/getWebContentProps.web.d.ts +5 -0
- package/lib/typescript/src/getWebContentProps.web.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/platformTapGestures.d.ts +2 -0
- package/lib/typescript/src/platformTapGestures.d.ts.map +1 -0
- package/lib/typescript/src/platformTapGestures.web.d.ts +2 -0
- package/lib/typescript/src/platformTapGestures.web.d.ts.map +1 -0
- package/lib/typescript/src/renderWindow.d.ts +44 -0
- package/lib/typescript/src/renderWindow.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +45 -52
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/useGestureViewer.d.ts +9 -8
- package/lib/typescript/src/useGestureViewer.d.ts.map +1 -1
- package/lib/typescript/src/useGestureViewerController.d.ts +1 -1
- package/lib/typescript/src/useGestureViewerManagerBridge.d.ts +28 -0
- package/lib/typescript/src/useGestureViewerManagerBridge.d.ts.map +1 -0
- package/lib/typescript/src/useGestureViewerPaging.d.ts +31 -2
- package/lib/typescript/src/useGestureViewerPaging.d.ts.map +1 -1
- package/lib/typescript/src/useWebClickHandler.d.ts +35 -0
- package/lib/typescript/src/useWebClickHandler.d.ts.map +1 -0
- package/lib/typescript/src/useWebClickHandler.web.d.ts +36 -0
- package/lib/typescript/src/useWebClickHandler.web.d.ts.map +1 -0
- package/lib/typescript/src/useWebSingleTapTimer.d.ts +6 -0
- package/lib/typescript/src/useWebSingleTapTimer.d.ts.map +1 -0
- package/lib/typescript/src/useWebSingleTapTimer.web.d.ts +6 -0
- package/lib/typescript/src/useWebSingleTapTimer.web.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +0 -20
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/tapZoom.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/GestureViewer.tsx +104 -191
- package/src/GestureViewerManager.ts +77 -122
- package/src/gestureViewerAnimation.ts +18 -0
- package/src/gestureViewerPaging.ts +116 -0
- package/src/gestureViewerRenderWindow.ts +56 -0
- package/src/getWebContentProps.ts +5 -0
- package/src/getWebContentProps.web.ts +5 -0
- package/src/index.tsx +1 -0
- package/src/platformTapGestures.ts +1 -0
- package/src/platformTapGestures.web.ts +1 -0
- package/src/renderWindow.ts +253 -0
- package/src/types.ts +44 -99
- package/src/useGestureViewer.ts +557 -258
- package/src/useGestureViewerController.ts +3 -3
- package/src/useGestureViewerManagerBridge.ts +118 -0
- package/src/useGestureViewerPaging.ts +277 -98
- package/src/useWebClickHandler.ts +44 -0
- package/src/useWebClickHandler.web.ts +146 -0
- package/src/useWebSingleTapTimer.ts +10 -0
- package/src/useWebSingleTapTimer.web.ts +30 -0
- package/src/utils/index.ts +0 -102
- package/src/utils/tapZoom.ts +4 -3
- package/lib/module/WebPagingFixStyle.js +0 -25
- package/lib/module/WebPagingFixStyle.js.map +0 -1
- package/lib/module/scheduleInitialScroll.js +0 -21
- package/lib/module/scheduleInitialScroll.js.map +0 -1
- package/lib/module/useGestureViewerPaging.types.js +0 -4
- package/lib/module/useGestureViewerPaging.types.js.map +0 -1
- package/lib/module/useGestureViewerPaging.web.js +0 -275
- package/lib/module/useGestureViewerPaging.web.js.map +0 -1
- package/lib/module/utils/FlashList.js +0 -9
- package/lib/module/utils/FlashList.js.map +0 -1
- package/lib/module/utils/webScroll.js +0 -70
- package/lib/module/utils/webScroll.js.map +0 -1
- package/lib/typescript/src/WebPagingFixStyle.d.ts +0 -6
- package/lib/typescript/src/WebPagingFixStyle.d.ts.map +0 -1
- package/lib/typescript/src/scheduleInitialScroll.d.ts +0 -3
- package/lib/typescript/src/scheduleInitialScroll.d.ts.map +0 -1
- package/lib/typescript/src/useGestureViewerPaging.types.d.ts +0 -41
- package/lib/typescript/src/useGestureViewerPaging.types.d.ts.map +0 -1
- package/lib/typescript/src/useGestureViewerPaging.web.d.ts +0 -3
- package/lib/typescript/src/useGestureViewerPaging.web.d.ts.map +0 -1
- package/lib/typescript/src/utils/FlashList.d.ts +0 -2
- package/lib/typescript/src/utils/FlashList.d.ts.map +0 -1
- package/lib/typescript/src/utils/webScroll.d.ts +0 -18
- package/lib/typescript/src/utils/webScroll.d.ts.map +0 -1
- package/src/WebPagingFixStyle.tsx +0 -25
- package/src/scheduleInitialScroll.ts +0 -36
- package/src/useGestureViewerPaging.types.ts +0 -41
- package/src/useGestureViewerPaging.web.ts +0 -434
- package/src/utils/FlashList.ts +0 -7
- package/src/utils/webScroll.ts +0 -96
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import type { FlatList as GHFlatList, ScrollView as GHScrollView } from 'react-native-gesture-handler';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
4
3
|
import type { WithTimingConfig } from 'react-native-reanimated';
|
|
5
|
-
export type FlatListComponent<ItemT> = typeof RNFlatList<ItemT> | typeof GHFlatList<ItemT>;
|
|
6
|
-
export type ScrollViewComponent = typeof RNScrollView | typeof GHScrollView;
|
|
7
|
-
interface ViewabilityConfigCallbackPair<TItem> {
|
|
8
|
-
viewabilityConfig: ViewabilityConfig;
|
|
9
|
-
onViewableItemsChanged: ((info: {
|
|
10
|
-
viewableItems: ViewToken<TItem>[];
|
|
11
|
-
changed: ViewToken<TItem>[];
|
|
12
|
-
}) => void) | null;
|
|
13
|
-
}
|
|
14
|
-
export type InstantiateGeneric<ItemT, LC> = LC extends React.ComponentType<infer P> ? P extends Record<string, any> ? {
|
|
15
|
-
[K in keyof P]: K extends 'data' ? ArrayLike<ItemT> | null | undefined : K extends 'renderItem' ? ListRenderItem<ItemT> : K extends 'keyExtractor' ? (item: ItemT, index: number) => string : K extends 'getItemType' ? (item: ItemT, index: number, extraData?: any) => string | number | undefined : K extends 'overrideItemLayout' ? (layout: {
|
|
16
|
-
span?: number;
|
|
17
|
-
size?: number;
|
|
18
|
-
}, item: ItemT, index: number, maxColumns?: number, extraData?: any) => void : K extends 'onViewableItemsChanged' ? FlatListProps<ItemT>['onViewableItemsChanged'] : K extends 'viewabilityConfigCallbackPairs' ? ViewabilityConfigCallbackPair<ItemT>[] : P[K];
|
|
19
|
-
} : P : never;
|
|
20
|
-
export type GetComponentProps<ItemT, LC> = LC extends React.ComponentType<any> ? InstantiateGeneric<ItemT, LC> : never;
|
|
21
|
-
type ConditionalListProps<ItemT, LC> = LC extends typeof RNFlatList<ItemT> ? React.ComponentProps<typeof RNFlatList<ItemT>> : LC extends typeof GHFlatList<ItemT> ? React.ComponentProps<typeof GHFlatList<ItemT>> : LC extends typeof RNScrollView ? React.ComponentProps<typeof RNScrollView> : LC extends typeof GHScrollView ? React.ComponentProps<typeof GHScrollView> : GetComponentProps<ItemT, LC>;
|
|
22
4
|
export type TriggerRect = {
|
|
23
5
|
x: number;
|
|
24
6
|
y: number;
|
|
@@ -31,6 +13,13 @@ export type GestureViewerSingleTapEvent<ItemT> = {
|
|
|
31
13
|
index: number;
|
|
32
14
|
item: ItemT;
|
|
33
15
|
};
|
|
16
|
+
export type GestureViewerRenderItemInfo = {
|
|
17
|
+
/**
|
|
18
|
+
* Whether the rendered item is currently active.
|
|
19
|
+
* @remarks The current item remains active during a page transition. When the transition finishes on another item, that item becomes active.
|
|
20
|
+
*/
|
|
21
|
+
readonly isActive: boolean;
|
|
22
|
+
};
|
|
34
23
|
export type GestureViewerDismissDirection = 'down' | 'up' | 'both';
|
|
35
24
|
export interface TriggerAnimationConfig extends WithTimingConfig {
|
|
36
25
|
/**
|
|
@@ -48,7 +37,7 @@ export interface TriggerAnimationConfig extends WithTimingConfig {
|
|
|
48
37
|
*/
|
|
49
38
|
onAnimationComplete?: () => void;
|
|
50
39
|
}
|
|
51
|
-
export interface GestureViewerProps<ItemT
|
|
40
|
+
export interface GestureViewerProps<ItemT> {
|
|
52
41
|
/**
|
|
53
42
|
* When you want to efficiently manage multiple `GestureViewer` instances, you can use the `id` prop to use multiple `GestureViewer` components.
|
|
54
43
|
* @remarks `GestureViewer` automatically removes instances from memory when components are unmounted, so no manual memory management is required.
|
|
@@ -75,8 +64,11 @@ export interface GestureViewerProps<ItemT, LC> {
|
|
|
75
64
|
onDismissStart?: () => void;
|
|
76
65
|
/**
|
|
77
66
|
* A callback function that is called to render the item.
|
|
67
|
+
* @param item - The item to render.
|
|
68
|
+
* @param index - The index of the item in `data`.
|
|
69
|
+
* @param info - Render state for this mounted slot.
|
|
78
70
|
*/
|
|
79
|
-
renderItem: (item: ItemT, index: number) => React.ReactElement;
|
|
71
|
+
renderItem: (item: ItemT, index: number, info: GestureViewerRenderItemInfo) => React.ReactElement;
|
|
80
72
|
/**
|
|
81
73
|
* A callback function that is called when a single tap is confirmed on the viewer content.
|
|
82
74
|
* @remarks
|
|
@@ -98,10 +90,6 @@ export interface GestureViewerProps<ItemT, LC> {
|
|
|
98
90
|
renderContainer?: (children: React.ReactElement, helpers: {
|
|
99
91
|
dismiss: () => void;
|
|
100
92
|
}) => React.ReactElement;
|
|
101
|
-
/**
|
|
102
|
-
* Support for any list component like `ScrollView`, `FlatList`, `FlashList` through the `ListComponent` prop.
|
|
103
|
-
*/
|
|
104
|
-
ListComponent: LC;
|
|
105
93
|
/**
|
|
106
94
|
* The width of the `GestureViewer`.
|
|
107
95
|
* @remarks If you don't set this prop, the width of the `GestureViewer` will be the same as the width of the screen.
|
|
@@ -114,11 +102,6 @@ export interface GestureViewerProps<ItemT, LC> {
|
|
|
114
102
|
* @defaultValue screen height
|
|
115
103
|
*/
|
|
116
104
|
height?: number;
|
|
117
|
-
/**
|
|
118
|
-
* The props to pass to the list component.
|
|
119
|
-
* @remarks The `listProps` provides **type inference based on the selected list component**, ensuring accurate autocompletion and type safety in your IDE.
|
|
120
|
-
*/
|
|
121
|
-
listProps?: Partial<ConditionalListProps<ItemT, LC>>;
|
|
122
105
|
/**
|
|
123
106
|
* The style of the backdrop.
|
|
124
107
|
*/
|
|
@@ -180,11 +163,28 @@ export interface GestureViewerProps<ItemT, LC> {
|
|
|
180
163
|
fadeBackdrop?: boolean;
|
|
181
164
|
};
|
|
182
165
|
/**
|
|
183
|
-
*
|
|
184
|
-
* @remarks
|
|
185
|
-
* @defaultValue true
|
|
166
|
+
* Horizontal swipe gesture options.
|
|
167
|
+
* @remarks Controls user-driven left/right page swipe gestures. Controller navigation and autoplay remain available when disabled.
|
|
186
168
|
*/
|
|
187
|
-
|
|
169
|
+
horizontalSwipe?: {
|
|
170
|
+
/**
|
|
171
|
+
* When `false`, user-driven horizontal page swipe gestures are disabled.
|
|
172
|
+
* @defaultValue true
|
|
173
|
+
*/
|
|
174
|
+
enabled?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Distance threshold as a ratio of viewer width.
|
|
177
|
+
* @remarks A page commits when absolute horizontal translation is strictly greater than `width * distanceThresholdRatio`, or when velocity passes `velocityThreshold`. Zero and finite values greater than `1` are accepted; negative and non-finite values fall back to the default.
|
|
178
|
+
* @defaultValue 0.25
|
|
179
|
+
*/
|
|
180
|
+
distanceThresholdRatio?: number;
|
|
181
|
+
/**
|
|
182
|
+
* Horizontal velocity threshold in points per second.
|
|
183
|
+
* @remarks A page commits when absolute horizontal velocity is strictly greater than `velocityThreshold`, or when distance passes `distanceThresholdRatio`. Zero and every finite non-negative value are accepted; negative and non-finite values fall back to the default.
|
|
184
|
+
* @defaultValue 800
|
|
185
|
+
*/
|
|
186
|
+
velocityThreshold?: number;
|
|
187
|
+
};
|
|
188
188
|
/**
|
|
189
189
|
* Only works when zoom is active, allows moving item position when zoomed.
|
|
190
190
|
* @remarks When `false`, gesture movement is disabled during zoom.
|
|
@@ -209,25 +209,17 @@ export interface GestureViewerProps<ItemT, LC> {
|
|
|
209
209
|
*/
|
|
210
210
|
enableLoop?: boolean;
|
|
211
211
|
/**
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
* @
|
|
215
|
-
* **`false` (default)**: Paging mode (`pagingEnabled: true`)
|
|
216
|
-
* - Scrolls by full screen size increments
|
|
217
|
-
*
|
|
218
|
-
* **`true`**: Snap mode (`snapToInterval` auto-calculated)
|
|
219
|
-
* - `snapToInterval` is automatically calculated based on `width` and `itemSpacing` values
|
|
220
|
-
* - Use this option when you need item spacing
|
|
221
|
-
* @defaultValue false
|
|
222
|
-
*
|
|
212
|
+
* Number of mounted render-window slots including the current item.
|
|
213
|
+
* @remarks Values are normalized to an odd number of at least 3. For example, `4` becomes `5`.
|
|
214
|
+
* @defaultValue 3
|
|
223
215
|
*/
|
|
224
|
-
|
|
216
|
+
windowSize?: number;
|
|
225
217
|
/**
|
|
226
|
-
*
|
|
227
|
-
* @remarks
|
|
218
|
+
* Horizontal visual space between pages.
|
|
219
|
+
* @remarks Page stride is `width + pageSpacing`; zoom bounds still use `width` and `height`.
|
|
228
220
|
* @defaultValue 0
|
|
229
221
|
*/
|
|
230
|
-
|
|
222
|
+
pageSpacing?: number;
|
|
231
223
|
/**
|
|
232
224
|
* The maximum zoom scale.
|
|
233
225
|
* @defaultValue 2
|
|
@@ -267,7 +259,7 @@ export type GestureViewerController = {
|
|
|
267
259
|
* Updates the currentIndex in the controller state.
|
|
268
260
|
*
|
|
269
261
|
* @param index - The target index (must be between 0 and totalCount - 1)
|
|
270
|
-
*
|
|
262
|
+
* Out-of-range indexes are ignored.
|
|
271
263
|
*
|
|
272
264
|
* @example
|
|
273
265
|
* ```typescript
|
|
@@ -277,7 +269,9 @@ export type GestureViewerController = {
|
|
|
277
269
|
* controller.goToIndex(totalCount - 1); // Go to last item
|
|
278
270
|
* ```
|
|
279
271
|
*/
|
|
280
|
-
goToIndex: (index: number
|
|
272
|
+
goToIndex: (index: number, options?: {
|
|
273
|
+
animated?: boolean;
|
|
274
|
+
}) => void;
|
|
281
275
|
/**
|
|
282
276
|
* Navigates to the previous item in the sequence.
|
|
283
277
|
* If already at the first item, behavior depends on implementation (may wrap or do nothing).
|
|
@@ -403,5 +397,4 @@ export type GestureViewerEventData = {
|
|
|
403
397
|
tap: SingleTapEventData;
|
|
404
398
|
};
|
|
405
399
|
export type GestureViewerEventCallback<T extends GestureViewerEventType> = (data: GestureViewerEventData[T]) => void;
|
|
406
|
-
export {};
|
|
407
400
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAA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MAAM,sBAAsB,GAAG,YAAY,GAAG,gBAAgB,GAAG,KAAK,CAAC;AAE7E,MAAM,MAAM,kBAAkB,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzF,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC5D,cAAc,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACtE,GAAG,EAAE,kBAAkB,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,CAAC,SAAS,sBAAsB,IAAI,CACzE,IAAI,EAAE,sBAAsB,CAAC,CAAC,CAAC,KAC5B,IAAI,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GestureViewerProps } from './types';
|
|
2
|
-
type UseGestureViewerProps<ItemT
|
|
3
|
-
export declare const useGestureViewer: <ItemT
|
|
2
|
+
type UseGestureViewerProps<ItemT> = Omit<GestureViewerProps<ItemT>, 'renderItem' | 'renderContainer' | 'containerStyle' | 'backdropStyle'>;
|
|
3
|
+
export declare const useGestureViewer: <ItemT>({ data, initialIndex, onDismiss, onSingleTap, width: customWidth, dismiss, enableDoubleTapZoom, enablePinchZoom, horizontalSwipe, enablePanWhenZoomed, enableLoop, maxZoomScale, pageSpacing, windowSize, height: customHeight, id, onDismissStart, triggerAnimation, autoPlay, autoPlayInterval, }: UseGestureViewerProps<ItemT>) => {
|
|
4
4
|
animatedStyle: import("react-native-reanimated/lib/typescript/hook/commonTypes").AnimatedStyleHandle<{
|
|
5
5
|
opacity: number;
|
|
6
6
|
transform: ({
|
|
@@ -28,18 +28,19 @@ export declare const useGestureViewer: <ItemT, LC>({ data, initialIndex, onDismi
|
|
|
28
28
|
backdropStyle: import("react-native-reanimated/lib/typescript/hook/commonTypes").AnimatedStyleHandle<{
|
|
29
29
|
opacity: number;
|
|
30
30
|
}>;
|
|
31
|
+
centerVirtualIndex: number;
|
|
32
|
+
currentIndex: number;
|
|
31
33
|
dataLength: number;
|
|
32
34
|
dismissGesture: import("react-native-gesture-handler/lib/typescript/handlers/gestures/panGesture").PanGesture;
|
|
33
35
|
handleDismiss: () => void;
|
|
36
|
+
horizontalPagingGesture: import("react-native-gesture-handler/lib/typescript/handlers/gestures/panGesture").PanGesture;
|
|
34
37
|
isPinching: boolean;
|
|
35
38
|
isRotated: boolean;
|
|
36
39
|
isZoomed: boolean;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
onScroll: ((event: import("react-native").NativeSyntheticEvent<import("react-native").NativeScrollEvent>) => void) | undefined;
|
|
42
|
-
onScrollBeginDrag: ((event: import("react-native").NativeSyntheticEvent<import("react-native").NativeScrollEvent>) => void) | undefined;
|
|
40
|
+
onWebClick: import("./useWebClickHandler").WebClickHandler;
|
|
41
|
+
pageStride: number;
|
|
42
|
+
renderWindowSlots: import("./renderWindow").RenderWindowSlot<ItemT>[];
|
|
43
|
+
visualPage: import("react-native-reanimated").SharedValue<number>;
|
|
43
44
|
zoomGesture: import("react-native-gesture-handler/lib/typescript/handlers/gestures/gestureComposition").ComposedGesture;
|
|
44
45
|
};
|
|
45
46
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGestureViewer.d.ts","sourceRoot":"","sources":["../../../src/useGestureViewer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGestureViewer.d.ts","sourceRoot":"","sources":["../../../src/useGestureViewer.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,kBAAkB,EAAe,MAAM,SAAS,CAAC;AAc/D,KAAK,qBAAqB,CAAC,KAAK,IAAI,IAAI,CACtC,kBAAkB,CAAC,KAAK,CAAC,EACzB,YAAY,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,eAAe,CACtE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,KAAK,EAAE,qSAqBrC,qBAAqB,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyjC9B,CAAC"}
|
|
@@ -6,7 +6,7 @@ import type { GestureViewerController } from './types';
|
|
|
6
6
|
* @returns Methods for controlling the viewer
|
|
7
7
|
*
|
|
8
8
|
* **Available methods:**
|
|
9
|
-
* - `goToIndex(index: number)` - Navigate to specific index (0 to totalCount-1)
|
|
9
|
+
* - `goToIndex(index: number, options?: { animated?: boolean })` - Navigate to specific index (0 to totalCount-1)
|
|
10
10
|
* - `goToPrevious()` - Navigate to previous item
|
|
11
11
|
* - `goToNext()` - Navigate to next item
|
|
12
12
|
* - `zoomIn(multiplier?: number)` - Zoom in (default: 0.25)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import type { SharedValue } from 'react-native-reanimated';
|
|
3
|
+
import type GestureViewerManager from './GestureViewerManager';
|
|
4
|
+
import type { GestureViewerNavigationOptions } from './GestureViewerManager';
|
|
5
|
+
type UseGestureViewerManagerBridgeOptions = {
|
|
6
|
+
currentIndexRef: RefObject<number>;
|
|
7
|
+
dataLengthRef: RefObject<number>;
|
|
8
|
+
goToIndex: (index: number, options?: GestureViewerNavigationOptions) => void;
|
|
9
|
+
goToNext: () => void;
|
|
10
|
+
goToPrevious: () => void;
|
|
11
|
+
hasRotationChangeListeners: SharedValue<boolean>;
|
|
12
|
+
hasZoomChangeListeners: SharedValue<boolean>;
|
|
13
|
+
height: number;
|
|
14
|
+
id: string;
|
|
15
|
+
managerRef: RefObject<GestureViewerManager | null>;
|
|
16
|
+
maxZoomScale: number;
|
|
17
|
+
rotation: SharedValue<number>;
|
|
18
|
+
scale: SharedValue<number>;
|
|
19
|
+
translateX: SharedValue<number>;
|
|
20
|
+
translateY: SharedValue<number>;
|
|
21
|
+
width: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Owns the registry-to-manager bridge side effects for one viewer instance.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useGestureViewerManagerBridge({ currentIndexRef, dataLengthRef, goToIndex, goToNext, goToPrevious, hasRotationChangeListeners, hasZoomChangeListeners, height, id, managerRef, maxZoomScale, rotation, scale, translateX, translateY, width, }: UseGestureViewerManagerBridgeOptions): void;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=useGestureViewerManagerBridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGestureViewerManagerBridge.d.ts","sourceRoot":"","sources":["../../../src/useGestureViewerManagerBridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,KAAK,oBAAoB,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAG7E,KAAK,oCAAoC,GAAG;IAC1C,eAAe,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACnC,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,KAAK,IAAI,CAAC;IAC7E,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,0BAA0B,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACjD,sBAAsB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,SAAS,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,eAAe,EACf,aAAa,EACb,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,0BAA0B,EAC1B,sBAAsB,EACtB,MAAM,EACN,EAAE,EACF,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,UAAU,EACV,UAAU,EACV,KAAK,GACN,EAAE,oCAAoC,QAuEtC"}
|
|
@@ -1,3 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type UseGestureViewerPagingOptions = {
|
|
2
|
+
centerVirtualIndex: number;
|
|
3
|
+
clearPendingWebSingleTap: () => void;
|
|
4
|
+
commitVirtualIndexOnly: (targetVirtualIndex: number) => void;
|
|
5
|
+
currentIndex: number;
|
|
6
|
+
dataLength: number;
|
|
7
|
+
enableLoop: boolean;
|
|
8
|
+
horizontalSwipeDistanceThresholdRatio: number;
|
|
9
|
+
horizontalSwipeEnabled: boolean;
|
|
10
|
+
horizontalSwipeVelocityThreshold: number;
|
|
11
|
+
initialPage: number;
|
|
12
|
+
isPinching: boolean;
|
|
13
|
+
isRotated: boolean;
|
|
14
|
+
isTriggerOpening: boolean;
|
|
15
|
+
isZoomed: boolean;
|
|
16
|
+
pageStride: number;
|
|
17
|
+
width: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Owns horizontal paging shared values, transition state, and paging commands.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useGestureViewerPaging({ centerVirtualIndex, clearPendingWebSingleTap, commitVirtualIndexOnly, currentIndex, dataLength, enableLoop, horizontalSwipeDistanceThresholdRatio, horizontalSwipeEnabled, horizontalSwipeVelocityThreshold, initialPage, isPinching, isRotated, isTriggerOpening, isZoomed, pageStride, width, }: UseGestureViewerPagingOptions): {
|
|
23
|
+
animateToVirtualPage: (targetVirtualIndex: number) => void;
|
|
24
|
+
cancelPagingInteraction: () => void;
|
|
25
|
+
horizontalPagingGesture: import("react-native-gesture-handler/lib/typescript/handlers/gestures/panGesture").PanGesture;
|
|
26
|
+
isPageTransitioningRef: import("react").RefObject<boolean>;
|
|
27
|
+
pageTransitionLocked: import("react-native-reanimated").SharedValue<boolean>;
|
|
28
|
+
snapToVirtualPage: (targetVirtualIndex: number) => void;
|
|
29
|
+
visualPage: import("react-native-reanimated").SharedValue<number>;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
3
32
|
//# sourceMappingURL=useGestureViewerPaging.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGestureViewerPaging.d.ts","sourceRoot":"","sources":["../../../src/useGestureViewerPaging.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGestureViewerPaging.d.ts","sourceRoot":"","sources":["../../../src/useGestureViewerPaging.ts"],"names":[],"mappings":"AAgBA,KAAK,6BAA6B,GAAG;IACnC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC,sBAAsB,EAAE,CAAC,kBAAkB,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,qCAAqC,EAAE,MAAM,CAAC;IAC9C,sBAAsB,EAAE,OAAO,CAAC;IAChC,gCAAgC,EAAE,MAAM,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,YAAY,EACZ,UAAU,EACV,UAAU,EACV,qCAAqC,EACrC,sBAAsB,EACtB,gCAAgC,EAChC,WAAW,EACX,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,KAAK,GACN,EAAE,6BAA6B;+CA+DP,MAAM;;;;;4CA9BN,MAAM;;EA0N9B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { SharedValue } from 'react-native-reanimated';
|
|
2
|
+
import type { ScheduleWebSingleTap } from './useWebSingleTapTimer';
|
|
3
|
+
export type WebTapTarget<ItemT> = {
|
|
4
|
+
index: number;
|
|
5
|
+
item: ItemT;
|
|
6
|
+
};
|
|
7
|
+
export type WebClickEvent = {
|
|
8
|
+
clientX: number;
|
|
9
|
+
clientY: number;
|
|
10
|
+
currentTarget: {
|
|
11
|
+
getBoundingClientRect: () => {
|
|
12
|
+
left: number;
|
|
13
|
+
top: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
detail: number;
|
|
17
|
+
};
|
|
18
|
+
export type WebClickHandler = (event: WebClickEvent) => void;
|
|
19
|
+
export type EmitSingleTap<ItemT> = (x: number, y: number, tapTarget?: WebTapTarget<ItemT>) => void;
|
|
20
|
+
export type WebClickHandlerConfig<ItemT> = {
|
|
21
|
+
clearPendingWebSingleTap: () => void;
|
|
22
|
+
emitSingleTap: EmitSingleTap<ItemT>;
|
|
23
|
+
enableDoubleTapZoom: boolean;
|
|
24
|
+
getCurrentTapTarget: () => WebTapTarget<ItemT> | null;
|
|
25
|
+
height: number;
|
|
26
|
+
isInteractionLocked: () => boolean;
|
|
27
|
+
maxZoomScale: number;
|
|
28
|
+
scale: SharedValue<number>;
|
|
29
|
+
scheduleWebSingleTap: ScheduleWebSingleTap;
|
|
30
|
+
translateX: SharedValue<number>;
|
|
31
|
+
translateY: SharedValue<number>;
|
|
32
|
+
width: number;
|
|
33
|
+
};
|
|
34
|
+
export declare function useWebClickHandler<ItemT>(_config: WebClickHandlerConfig<ItemT>): WebClickHandler;
|
|
35
|
+
//# sourceMappingURL=useWebClickHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWebClickHandler.d.ts","sourceRoot":"","sources":["../../../src/useWebClickHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,MAAM,MAAM,YAAY,CAAC,KAAK,IAAI;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE;QACb,qBAAqB,EAAE,MAAM;YAC3B,IAAI,EAAE,MAAM,CAAC;YACb,GAAG,EAAE,MAAM,CAAC;SACb,CAAC;KACH,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;AAE7D,MAAM,MAAM,aAAa,CAAC,KAAK,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;AAEnG,MAAM,MAAM,qBAAqB,CAAC,KAAK,IAAI;IACzC,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC,aAAa,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,MAAM,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,OAAO,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,qBAAqB,CAAC,KAAK,CAAC,GAAG,eAAe,CAEhG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { SharedValue } from 'react-native-reanimated';
|
|
2
|
+
import type { ScheduleWebSingleTap } from './useWebSingleTapTimer';
|
|
3
|
+
export type WebTapTarget<ItemT> = {
|
|
4
|
+
index: number;
|
|
5
|
+
item: ItemT;
|
|
6
|
+
};
|
|
7
|
+
export type WebClickEvent = {
|
|
8
|
+
clientX: number;
|
|
9
|
+
clientY: number;
|
|
10
|
+
currentTarget: {
|
|
11
|
+
getBoundingClientRect: () => {
|
|
12
|
+
left: number;
|
|
13
|
+
top: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
detail: number;
|
|
17
|
+
};
|
|
18
|
+
export type WebClickHandler = (event: WebClickEvent) => void;
|
|
19
|
+
export type EmitSingleTap<ItemT> = (x: number, y: number, tapTarget?: WebTapTarget<ItemT>) => void;
|
|
20
|
+
export type WebClickHandlerConfig<ItemT> = {
|
|
21
|
+
clearPendingWebSingleTap: () => void;
|
|
22
|
+
emitSingleTap: EmitSingleTap<ItemT>;
|
|
23
|
+
enableDoubleTapZoom: boolean;
|
|
24
|
+
getCurrentTapTarget: () => WebTapTarget<ItemT> | null;
|
|
25
|
+
height: number;
|
|
26
|
+
isInteractionLocked: () => boolean;
|
|
27
|
+
maxZoomScale: number;
|
|
28
|
+
scale: SharedValue<number>;
|
|
29
|
+
scheduleWebSingleTap: ScheduleWebSingleTap;
|
|
30
|
+
translateX: SharedValue<number>;
|
|
31
|
+
translateY: SharedValue<number>;
|
|
32
|
+
width: number;
|
|
33
|
+
};
|
|
34
|
+
export declare function createWebClickHandler<ItemT>({ clearPendingWebSingleTap, emitSingleTap, enableDoubleTapZoom, getCurrentTapTarget, height, isInteractionLocked, maxZoomScale, scale, scheduleWebSingleTap, translateX, translateY, width, }: WebClickHandlerConfig<ItemT>): WebClickHandler;
|
|
35
|
+
export declare function useWebClickHandler<ItemT>({ clearPendingWebSingleTap, emitSingleTap, enableDoubleTapZoom, getCurrentTapTarget, height, isInteractionLocked, maxZoomScale, scale, scheduleWebSingleTap, translateX, translateY, width, }: WebClickHandlerConfig<ItemT>): WebClickHandler;
|
|
36
|
+
//# sourceMappingURL=useWebClickHandler.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWebClickHandler.web.d.ts","sourceRoot":"","sources":["../../../src/useWebClickHandler.web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,MAAM,MAAM,YAAY,CAAC,KAAK,IAAI;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE;QACb,qBAAqB,EAAE,MAAM;YAC3B,IAAI,EAAE,MAAM,CAAC;YACb,GA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AAmB,EACnB,YAAY,EACZ,KAAK,EACL,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,KAAK,GACN,EAAE,qBAAqB,CAAC,KAAK,CAAC,GAAG,eAAe,CAgChD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type ScheduleWebSingleTap = (callback: () => void, delay?: number) => void;
|
|
2
|
+
export declare function useWebSingleTapTimer(): {
|
|
3
|
+
clearPendingWebSingleTap: () => void;
|
|
4
|
+
scheduleWebSingleTap: ScheduleWebSingleTap;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=useWebSingleTapTimer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWebSingleTapTimer.d.ts","sourceRoot":"","sources":["../../../src/useWebSingleTapTimer.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;AAElF,wBAAgB,oBAAoB;;;EAKnC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type ScheduleWebSingleTap = (callback: () => void, delay?: number) => void;
|
|
2
|
+
export declare function useWebSingleTapTimer(): {
|
|
3
|
+
clearPendingWebSingleTap: () => void;
|
|
4
|
+
scheduleWebSingleTap: ScheduleWebSingleTap;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=useWebSingleTapTimer.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWebSingleTapTimer.web.d.ts","sourceRoot":"","sources":["../../../src/useWebSingleTapTimer.web.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;AAElF,wBAAgB,oBAAoB;;;EAyBnC"}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import { type PlatformOSType } from 'react-native';
|
|
2
|
-
import type { FlatListComponent, ScrollViewComponent } from '../types';
|
|
3
|
-
export declare const isScrollViewLike: (component: React.ComponentType<any>) => component is ScrollViewComponent;
|
|
4
|
-
export declare const isFlatListLike: (component: React.ComponentType<any>) => component is FlatListComponent<any>;
|
|
5
|
-
export declare const isFlashListLike: (component: React.ComponentType<any>) => boolean;
|
|
6
|
-
/**
|
|
7
|
-
* iOS needs the extra Native gesture wrapper so the dismiss pan can resolve before the scrollable claims touches.
|
|
8
|
-
* We intentionally skip Android because the same require-to-fail relation regressed horizontal paging there,
|
|
9
|
-
* and we also avoid wrapping RNGH-provided scrollables to prevent double-applying Gesture.Native() to components that already participate in RNGH.
|
|
10
|
-
*/
|
|
11
|
-
export declare const shouldUseNativeScrollGesture: (platformOS: PlatformOSType, component: React.ComponentType<any>) => boolean;
|
|
12
1
|
export declare const createBoundsConstraint: ({ width, height }: {
|
|
13
2
|
width: number;
|
|
14
3
|
height: number;
|
|
@@ -20,13 +9,4 @@ export declare const createBoundsConstraint: ({ width, height }: {
|
|
|
20
9
|
translateX: number;
|
|
21
10
|
translateY: number;
|
|
22
11
|
};
|
|
23
|
-
export declare const createLoopData: <T>(dataRef: React.RefObject<T[]>, enableLoop: boolean) => T[];
|
|
24
|
-
export declare const getLoopAdjustedIndex: (scrollIndex: number, originalDataLength: number, enableLoop: boolean) => {
|
|
25
|
-
realIndex: number;
|
|
26
|
-
needsJump: boolean;
|
|
27
|
-
jumpToIndex?: number;
|
|
28
|
-
};
|
|
29
|
-
export declare const createScrollAction: (listRef: any, width: number) => {
|
|
30
|
-
scrollTo: (index: number, animated: boolean) => void;
|
|
31
|
-
};
|
|
32
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,GAChC,mBAAmB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,MACpD,oCAIE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;;;CAiBA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tapZoom.d.ts","sourceRoot":"","sources":["../../../../src/utils/tapZoom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,eAAO,MAAM,mBAAmB,GAAI,uEASjC;IACD,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACjC,
|
|
1
|
+
{"version":3,"file":"tapZoom.d.ts","sourceRoot":"","sources":["../../../../src/utils/tapZoom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG3D,eAAO,MAAM,mBAAmB,GAAI,uEASjC;IACD,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACjC,SAuBA,CAAC"}
|