-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
109 lines (101 loc) · 2.3 KB
/
types.ts
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import { GestureResponderEvent, StyleProp, ViewStyle } from 'react-native';
import Animated, { AnimatedStyleProp } from 'react-native-reanimated';
export interface Thread {
id: number;
backgroundColor: string;
}
export interface ThreadStackProps {
/**
* The data to be rendered in the stack
*/
data: Array<Thread>;
/**
* Callback on swipe left action
* @param item the value of item which was swiped left
*/
onSwipeLeft?: (item: Thread) => void;
/**
* Callback on swipe right action
* @param item the value of item which was swiped right
* @returns
*/
onSwipeRight?: (item: Thread) => void;
/**
* Whether to allow swipe gestures or not
*/
allowSwipe?: boolean;
/**
* Header configuration
*/
header?: {
/**
* Whether to show the header or not
*/
visible: boolean;
/**
* Whether to show the number of threads left or not
*/
showNumberOfThreadsLeft: boolean;
/**
* Whether to show the undo button or not
*/
showUndoButton: boolean;
/**
* Whether to show the reset icon button or not
*/
showResetIconButton: boolean;
};
/**
* To toggle visibility of action buttons at the bottom
*/
showActionButtons?: boolean;
/**
* Configuration for the stack end view
*/
stackEnd?: {
/**
* Emoji to be shown
*/
emoji: string;
/**
* Heading to be shown
*/
heading: string;
/**
* Whether to show the reset button or not
*/
showReset: boolean;
};
}
export interface ThreadCardProps {
style?: StyleProp<ViewStyle>;
thread: Thread;
}
export interface ButtonProps {
title: string;
variant?: 'primary' | 'secondary';
onPress?:
| ((event: GestureResponderEvent) => void)
| Animated.SharedValue<(event: GestureResponderEvent) => void>;
}
export interface HeaderProps {
showNumberOfThreadsLeft?: boolean;
showUndoButton?: boolean;
showResetIconButton?: boolean;
numberOfThreadsLeft: number;
currentThreadIndex: number;
onReset: () => void;
onUndo: () => void;
}
export interface OverlayProps {
animatedStyle: AnimatedStyleProp<ViewStyle>;
}
export interface StackEndProps {
onReset: () => void;
emoji?: string;
heading?: string;
}
export interface ThreadActionsProps {
onMarkRead: () => void;
onMarkUnread: () => void;
}