diff --git a/types/react-native-snap-carousel/index.d.ts b/types/react-native-snap-carousel/index.d.ts index 0679b4ac82..05edf13bd8 100644 --- a/types/react-native-snap-carousel/index.d.ts +++ b/types/react-native-snap-carousel/index.d.ts @@ -419,3 +419,17 @@ export type PaginationProperties = PaginationProps & React.Props { } export default class Carousel extends React.Component> { } + +/** + * Get scroll interpolator's input range from an array of slide indexes + * Indexes are relative to the current active slide (index 0) + * For example, using [3, 2, 1, 0, -1] will return: + * [ + * (index - 3) * sizeRef, // active + 3 + * (index - 2) * sizeRef, // active + 2 + * (index - 1) * sizeRef, // active + 1 + * index * sizeRef, // active + * (index + 1) * sizeRef // active - 1 + * ] + */ +export function getInputRangeFromIndexes(range: number[], index: number, carouselProps: CarouselProps): number[];