UNPKG

@kirz/react-native-toolkit

Version:

Toolkit to speed up React Native development

60 lines 2.75 kB
import React from 'react'; import { ViewProps } from '../View'; import { ForwardedRef } from 'react'; import { EasingFunction, ImageProps } from 'react-native'; import { SharedValue, ReduceMotion, EasingFunctionFactory } from 'react-native-reanimated'; import { Anim, Asset, TinderPhoto } from './TinderPhotoSwiper'; type Status = 'active' | 'inactive' | 'like' | 'dislike' | 'skip'; type AnimationConfig = { duration?: number; reduceMotion?: ReduceMotion; easing?: EasingFunction | EasingFunctionFactory; }; export type TinderPhotoSwiperCardProps<T extends Asset = Asset, K extends Anim = Anim> = ViewProps & { photo: TinderPhoto<T>; imageProps?: Omit<ImageProps, 'source'>; states: Record<Status, K>; likeActivationValue: SharedValue<number>; dislikeActivationValue: SharedValue<number>; favouriteActivationValue: SharedValue<number>; resetAnimation?: AnimationConfig; swipeAnimation?: AnimationConfig; maxActivationTranslation?: { x: number; y: number; }; onLike: () => void; onDislike: () => void; onFavorite: (photo: T, value: boolean) => void; }; export type TinderPhotoSwiperCardRef = { setStatus: (status: Status) => void; setVisibility: (value: boolean) => void; toggleFavorite: () => void; }; declare function TinderPhotoSwiperCardWrapper<T extends Asset>({ likeActivationValue, dislikeActivationValue, favouriteActivationValue, photo: initialPhoto, imageProps, states, resetAnimation, swipeAnimation, maxActivationTranslation, onLike, onDislike, onFavorite, ...props }: TinderPhotoSwiperCardProps<T>, ref: ForwardedRef<TinderPhotoSwiperCardRef>): JSX.Element | null; export declare const TinderPhotoSwiperCard: <T extends Asset = Asset>(props: Omit<import("react-native").ViewProps, "style"> & { style?: import("react-native").StyleProp<import("../View").ViewStyle>; skeleton?: boolean | undefined; skeletonStyle?: import("react-native").StyleProp<import("../View").ViewStyle>; } & { photo: TinderPhoto<T>; imageProps?: Omit<ImageProps, "source"> | undefined; states: Record<Status, Anim>; likeActivationValue: SharedValue<number>; dislikeActivationValue: SharedValue<number>; favouriteActivationValue: SharedValue<number>; resetAnimation?: AnimationConfig | undefined; swipeAnimation?: AnimationConfig | undefined; maxActivationTranslation?: { x: number; y: number; } | undefined; onLike: () => void; onDislike: () => void; onFavorite: (photo: T, value: boolean) => void; } & { ref?: React.ForwardedRef<TinderPhotoSwiperCardRef> | undefined; }) => ReturnType<typeof TinderPhotoSwiperCardWrapper>; export {}; //# sourceMappingURL=TinderPhotoSwiperCard.d.ts.map