Skip to content

Commit

Permalink
Merge pull request #441 from jemise111/fix-types-and-flow
Browse files Browse the repository at this point in the history
Fix types for new props
  • Loading branch information
jemise111 authored Mar 28, 2020
2 parents 53a4b0a + 994ef84 commit ae0335c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions types/flowtypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
export type SwipeRowPropsType = {
setScrollEnabled?: Function,
swipeGestureBegan?: Function,
swipeGestureEnded?: Function,
onRowOpen?: Function,
onRowDidOpen?: Function,
leftOpenValue?: number,
Expand Down Expand Up @@ -72,6 +73,7 @@ export type SwipeListPropsType = {
recalculateHiddenLayout: boolean,
disableHiddenLayoutCalculation: boolean,
swipeGestureBegan?: Function,
swipeGestureEnded?: Function,
onRowOpen?: Function,
onRowDidOpen?: Function,
onRowClose?: Function,
Expand All @@ -97,6 +99,7 @@ export type SwipeListPropsType = {
shouldItemUpdate?: Function,
onSwipeValueChange?: Function,
useNativeDriver: boolean,
useAnimatedList: boolean,
renderHiddenRow?: Function,
keyExtractor?: any,
scrollEnabled?: boolean,
Expand Down
12 changes: 12 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ interface IPropsSwipeRow<T> {
* Called when it has been detected that a row should be swiped open.
*/
swipeGestureBegan(): void;
/**
* Called when user has ended their swipe gesture
*/
swipeGestureEnded(): void;
/**
* Called when a swipe row is animating open. Used by the SwipeListView
* to keep references to open rows.
Expand Down Expand Up @@ -248,6 +252,10 @@ interface IPropsSwipeListView<T> {
* Called when a swipe row is animating swipe
*/
swipeGestureBegan(rowKey: string): void;
/**
* Called when user has ended their swipe gesture
*/
swipeGestureEnded(rowKey: string): void;
/**
* Called when a swipe row is animating open
*/
Expand Down Expand Up @@ -362,6 +370,10 @@ interface IPropsSwipeListView<T> {
direction: 'left' | 'right';
isOpen: boolean;
}): void;
/**
* Use Animated.Flatlist or Animated.Sectionlist
*/
useAnimateList: boolean;
}

type SectionListPropsOverride<T> = Omit<SectionListProps<T>, 'renderItem'>
Expand Down

0 comments on commit ae0335c

Please sign in to comment.