refactor: use same type for animation context and interpolation props

This commit is contained in:
Satyajit Sahoo
2019-11-07 08:06:42 +01:00
parent c63259df37
commit 7aab6568eb
3 changed files with 28 additions and 37 deletions

View File

@@ -1,24 +1,6 @@
import * as React from 'react';
import Animated from 'react-native-reanimated';
import { Layout } from '../types';
import { CardInterpolationProps } from '../types';
type StackCardAnimationContextType = {
current: { progress: Animated.Node<number> };
next?: { progress: Animated.Node<number> };
index: number;
closing: Animated.Node<0 | 1>;
swiping: Animated.Node<0 | 1>;
layouts: {
screen: Layout;
};
insets: {
top: number;
right: number;
bottom: number;
left: number;
};
};
export default React.createContext<StackCardAnimationContextType | undefined>(
export default React.createContext<CardInterpolationProps | undefined>(
undefined
);