Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor TS changes #2872

Merged
merged 5 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/handlers/PanGestureHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ export interface PanGestureHandlerProps
* to 0. If only one number `p` is given a range of `(-inf, p)` will be used
* if `p` is higher or equal to 0 and `(-p, inf)` otherwise.
*/
activeOffsetY?: number | number[];
activeOffsetY?:
| number
| [activeOffsetYStart: number, activeOffsetYEnd: number];
j-piasecki marked this conversation as resolved.
Show resolved Hide resolved

/**
* Range along X axis (in points) where fingers travels without activation of
Expand All @@ -160,7 +162,9 @@ export interface PanGestureHandlerProps
* to 0. If only one number `p` is given a range of `(-inf, p)` will be used
* if `p` is higher or equal to 0 and `(-p, inf)` otherwise.
*/
activeOffsetX?: number | number[];
activeOffsetX?:
| number
| [activeOffsetXStart: number, activeOffsetXEnd: number];

/**
* When the finger moves outside this range (in points) along Y axis and
Expand All @@ -170,7 +174,7 @@ export interface PanGestureHandlerProps
* to 0. If only one number `p` is given a range of `(-inf, p)` will be used
* if `p` is higher or equal to 0 and `(-p, inf)` otherwise.
*/
failOffsetY?: number | number[];
failOffsetY?: number | [failOffsetYStart: number, failOffsetYEnd: number];

/**
* When the finger moves outside this range (in points) along X axis and
Expand All @@ -180,7 +184,7 @@ export interface PanGestureHandlerProps
* to 0. If only one number `p` is given a range of `(-inf, p)` will be used
* if `p` is higher or equal to 0 and `(-p, inf)` otherwise.
*/
failOffsetX?: number | number[];
failOffsetX?: number | [failOffsetXStart: number, failOffsetXEnd: number];
}

export const panHandlerName = 'PanGestureHandler';
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
const currentArr = [...array];
const transformedArr: Transformed[] = [];
currentArr.forEach((current, i) => {
const previous = previousArr[i];
const previous = previousArr[i] as Transformed | null;

Check failure on line 21 in src/utils.ts

View workflow job for this annotation

GitHub Actions / check

This assertion is unnecessary since it does not change the type of the expression
const transformed = mapFn(previous, current);
previousArr.push(transformed);
transformedArr.push(transformed);
Expand Down
Loading