@@ -18,6 +18,7 @@ import type {
1818} from 'react-native' ;
1919import type Animated from 'react-native-reanimated' ;
2020import type { ScrollEventsHandlersHookType } from '../../types' ;
21+ import type { FlashListProps } from '@shopify/flash-list' ;
2122
2223export interface BottomSheetScrollableProps {
2324 /**
@@ -62,6 +63,7 @@ export interface BottomSheetScrollableProps {
6263export type ScrollableProps < T > =
6364 | ScrollViewProps
6465 | FlatListProps < T >
66+ | FlashListProps < T >
6567 | SectionListProps < T > ;
6668
6769//#region FlatList
@@ -142,6 +144,87 @@ export interface BottomSheetFlatListMethods {
142144}
143145//#endregion
144146
147+ //#region FlatList
148+ export type BottomSheetFlashListProps < T > = Omit <
149+ FlashListProps < T > ,
150+ | 'decelerationRate'
151+ | 'onScroll'
152+ | 'scrollEventThrottle'
153+ | 'renderScrollComponent'
154+ > &
155+ BottomSheetScrollableProps & {
156+ ref ?: Ref < BottomSheetFlashListMethods > ;
157+ } ;
158+
159+ export interface BottomSheetFlashListMethods {
160+ /**
161+ * Scrolls to the end of the content. May be janky without `getItemLayout` prop.
162+ */
163+ scrollToEnd : ( params ?: { animated ?: boolean | null } ) => void ;
164+
165+ /**
166+ * Scrolls to the item at the specified index such that it is positioned in the viewable area
167+ * such that viewPosition 0 places it at the top, 1 at the bottom, and 0.5 centered in the middle.
168+ * Cannot scroll to locations outside the render window without specifying the getItemLayout prop.
169+ */
170+ scrollToIndex : ( params : {
171+ animated ?: boolean | null ;
172+ index : number ;
173+ viewOffset ?: number ;
174+ viewPosition ?: number ;
175+ } ) => void ;
176+
177+ /**
178+ * Requires linear scan through data - use `scrollToIndex` instead if possible.
179+ * May be janky without `getItemLayout` prop.
180+ */
181+ scrollToItem : ( params : {
182+ animated ?: boolean | null ;
183+ item : any ;
184+ viewPosition ?: number ;
185+ } ) => void ;
186+
187+ /**
188+ * Scroll to a specific content pixel offset, like a normal `ScrollView`.
189+ */
190+ scrollToOffset : ( params : {
191+ animated ?: boolean | null ;
192+ offset : number ;
193+ } ) => void ;
194+
195+ /**
196+ * Tells the list an interaction has occured, which should trigger viewability calculations,
197+ * e.g. if waitForInteractions is true and the user has not scrolled. This is typically called
198+ * by taps on items or by navigation actions.
199+ */
200+ recordInteraction : ( ) => void ;
201+
202+ /**
203+ * Displays the scroll indicators momentarily.
204+ */
205+ flashScrollIndicators : ( ) => void ;
206+
207+ /**
208+ * Provides a handle to the underlying scroll responder.
209+ */
210+ getScrollResponder : ( ) => ScrollResponderMixin | null | undefined ;
211+
212+ /**
213+ * Provides a reference to the underlying host component
214+ */
215+ getNativeScrollRef : ( ) =>
216+ | RefObject < View >
217+ | RefObject < ScrollViewComponent >
218+ | null
219+ | undefined ;
220+
221+ getScrollableNode : ( ) => any ;
222+
223+ // TODO: use `unknown` instead of `any` for Typescript >= 3.0
224+ setNativeProps : ( props : { [ key : string ] : any } ) => void ;
225+ }
226+ //#endregion
227+
145228//#region ScrollView
146229export type BottomSheetScrollViewProps = Omit <
147230 Animated . AnimateProps < ScrollViewProps > ,
0 commit comments