-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathTouchableProps.ts
More file actions
40 lines (33 loc) · 1.41 KB
/
Copy pathTouchableProps.ts
File metadata and controls
40 lines (33 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import type { BaseButtonProps, RawButtonProps } from '../GestureButtonsProps';
import type { GestureEndEvent, GestureEvent } from '../../types';
import type { ButtonProps } from '../../../components/GestureHandlerButton';
import type { NativeHandlerData } from '../../hooks/gestures/native/NativeTypes';
import type { PressableAndroidRippleConfig as RNPressableAndroidRippleConfig } from 'react-native';
export type CallbackEventType = GestureEvent<NativeHandlerData>;
export type EndCallbackEventType = GestureEndEvent<NativeHandlerData>;
type PressableAndroidRippleConfig = {
[K in keyof RNPressableAndroidRippleConfig]?: Exclude<
RNPressableAndroidRippleConfig[K],
null
>;
};
type RippleProps = 'rippleColor' | 'rippleRadius' | 'borderless' | 'foreground';
export type TouchableProps = Omit<ButtonProps, RippleProps | 'enabled'> &
Omit<BaseButtonProps, keyof RawButtonProps> & {
/**
* Configuration for the ripple effect on Android.
*/
androidRipple?: PressableAndroidRippleConfig | undefined;
/**
* Called when pointer touches the component.
*/
onPressIn?: ((event: CallbackEventType) => void) | undefined;
/**
* Called when pointer is released from the component.
*/
onPressOut?: ((event: CallbackEventType) => void) | undefined;
/**
* Whether the component should ignore touches. By default set to false.
*/
disabled?: boolean | undefined;
};