diff --git a/types/index.d.ts b/types/index.d.ts index bd71cf6..6d5e174 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,5 +1,5 @@ import { Component } from 'react'; -import { StyleProp, ViewStyle, ListView, NativeSyntheticEvent, NativeScrollEvent, ListRenderItemInfo, ListViewDataSource, SectionListProps, FlatListProps, GestureResponderEvent, PanResponderGestureState } from 'react-native'; +import { StyleProp, ViewStyle, ListView, NativeSyntheticEvent, NativeScrollEvent, ListRenderItemInfo, ListViewDataSource, SectionListProps, FlatListProps, GestureResponderEvent, PanResponderGestureState, FlatList } from 'react-native'; type SwipeGestureEndedData = { translateX: number; @@ -219,6 +219,8 @@ type IRenderListViewProps = Omit, 'useFlatLi type RowMap = { [open_cell_key: string]: SwipeRow; }; +export type ListViewRef = SwipeListView & FlatList; + interface IPropsSwipeListView { // data: T[]; // sections: Array<{ @@ -392,7 +394,7 @@ interface IPropsSwipeListView { * Called when the ListView (or FlatList) ref is set and passes a ref to the ListView (or FlatList) * e.g. listViewRef={ ref => this._swipeListViewRef = ref } */ - listViewRef(ref: SwipeListView): void; + listViewRef(ref: ListViewRef): void; /** * Should the row with this key do a slide out preview to show that the list is swipeable */