@cometchat/chat-uikit-react-native
Version:
Ready-to-use Chat UI Components for React Native
89 lines (88 loc) • 3.07 kB
TypeScript
import { ReactNativeZoomableViewState, ReactNativeZoomableViewWithGesturesProps, ZoomableViewEvent } from "./types";
import React from "react";
import ReactNativeZoomableView from "./ReactNativeZoomableView";
import { GestureResponderEvent, PanResponderGestureState } from "react-native";
export declare const swipeDirections: {
SWIPE_UP: string;
SWIPE_DOWN: string;
SWIPE_LEFT: string;
SWIPE_RIGHT: string;
};
declare class ReactNativeZoomableViewWithGestures extends React.Component<ReactNativeZoomableViewWithGesturesProps, ReactNativeZoomableViewState> {
zoomableViewRef: React.RefObject<ReactNativeZoomableView | null>;
constructor(props: ReactNativeZoomableViewWithGesturesProps);
_onShiftingEnd: (e: GestureResponderEvent, gestureState: PanResponderGestureState, zoomableViewState: ZoomableViewEvent) => void;
/**
* Checks if current config options make it possible to process a swipe or if is not necessary
*
* @returns {*}
* @private
*/
_couldCallSwipeEvent(zoomableViewState: {
zoomLevel: number;
}): false | ((swipeDirection: import("./types").SwipeDirection, gestureState: PanResponderGestureState) => void) | ((gestureState: PanResponderGestureState) => void) | undefined;
/**
* Checks the swipe and validates whether we should process it or not
*
* @param gestureState
* @returns {*|boolean}
*
* @private
*/
_validateSwipe(gestureState: any): boolean | undefined;
/**
* Triggers the correct directional callback
*
* @param swipeDirection
* @param gestureState
* @private
*/
_triggerSwipeHandlers(swipeDirection: any, gestureState: PanResponderGestureState): void;
/**
* Calculates what direction the user swiped
*
* @param gestureState
* @returns {*}
* @private
*/
_getSwipeDirection(gestureState: any): string | null;
/**
* Checks, whether the swipe was done in a horizontal fashion, respecting swipeVelocityThreshold limits
*
* @param gestureState
* @returns {*}
*
* @private
*/
_isValidHorizontalSwipe(gestureState: {
vx: any;
dy: any;
}): boolean;
/**
* Checks, whether the swipe was done in a vertical fashion, respecting swipeVelocityThreshold limits
*
* @param gestureState
* @returns {*}
*
* @private
*/
_isValidVerticalSwipe(gestureState: {
vy: any;
dx: any;
}): boolean;
/**
* Checks the sipw against velocity and directional offset to make sure it only gets activated, when we actually need it
*
* @param velocity
* @param swipeVelocityThreshold
* @param directionalOffset
* @param swipeDirectionalThreshold
*
* @returns {boolean}
*
* @private
*/
_isValidSwipe(velocity: number, swipeVelocityThreshold: any, directionalOffset: number, swipeDirectionalThreshold: any): boolean;
render(): React.JSX.Element;
}
export default ReactNativeZoomableViewWithGestures;