From acf4d60b11ec2212ceddf101dba92db8f516e9d0 Mon Sep 17 00:00:00 2001 From: peterpaker48 Date: Fri, 3 Jan 2020 14:52:51 -0800 Subject: [PATCH] Add type definition for manuallySwipeRow Following @jemise111 's comment in https://github.com/jemise111/react-native-swipe-list-view/issues/361#issuecomment-552114614 > I'm hesitant to add it to types because it's not really supported functionality (though a PR is always welcome if you'd like to add it) I feel like it's been recommended a few times in the issues by the author, so that it is de facto "supported" , might as well have the type definition? Tested in a local project by adding ``` declare module 'react-native-swipe-list-view' { interface SwipeRow { manuallySwipeRow: (toValue: number, onAnimationEnd?: () => void) => void; } } ``` and verifying no typescript error on usage of `manuallySwipeRow` --- types/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/index.d.ts b/types/index.d.ts index abde63a..3f826ef 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -140,6 +140,7 @@ export class SwipeRow extends Component>> { closeRow: () => void; closeRowWithoutAnimation: () => void; render(): JSX.Element; + manuallySwipeRow: (toValue: number, onAnimationEnd?: () => void) => void; } type IRenderListViewProps = Omit, 'useFlatList'>, 'useSectionList'>, 'renderListView'>;