UNPKG

1.36 kBTypeScriptView Raw
1import { ComponentType } from 'react'
2
3import { StandardProps } from '../common'
4
5interface PanGestureHandlerProps extends StandardProps {
6 /** 声明手势协商时的组件标识
7 * @supported weapp
8 */
9 tag?: string
10 /** 手势识别成功的回调
11 * @supported weapp
12 */
13 onGestureWorklet?: string
14 /** 手指移动过程中手势是否响应
15 * @supported weapp
16 */
17 shouldResponseOnMoveWorklet?: string
18 /** 手势是否应该被识别
19 * @supported weapp
20 */
21 shouldAcceptGestureWorklet?: string
22 /** 声明可同时触发的手势节点
23 * @supported weapp
24 */
25 simultaneousHandlers?: string[]
26 /** 代理的原生节点类型
27 * @supported weapp
28 */
29 nativeView?: string
30}
31
32/**拖动(横向/纵向)时触发手势
33 * 微信小程序下 skyline 的手势标签,只能在 CompileMode 中使用
34 * @supported weapp
35 * @example_react
36 * ```tsx
37 * import { Component } from 'react'
38 * import { View, PanGestureHandler } from '@tarojs/components'
39 *
40 * export function Index () {
41 * return (
42 * <View compileMode>
43 * <PanGestureHandler onGestureWorklet="onGesture">
44 * <View className='circle'></View>
45 * </PanGestureHandler>
46 * </View>
47 * )
48 * }
49 * ```
50 */
51declare const PanGestureHandler: ComponentType<PanGestureHandlerProps>
52
53export { PanGestureHandler, PanGestureHandlerProps }