From 39b4723424d50447bcce7cac1fe3c2b8a223d0cc Mon Sep 17 00:00:00 2001 From: Adam Keating <1427265+akeating@users.noreply.github.com> Date: Mon, 29 Apr 2019 17:45:31 -0700 Subject: [PATCH] Adds missing export getInputRangeFromIndexes (#35088) --- types/react-native-snap-carousel/index.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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[];