react-native-theme-switch-animation
Version:
A Plug & Play Animations for Switching (Dark/Light) Themes. 🌖
48 lines (40 loc) • 905 B
TypeScript
type CircularAnimationType = 'circular' | 'inverted-circular';
type CircularAnimationConfig = {
type: CircularAnimationType;
duration: number;
startingPoint: {
cxRatio: number;
cyRatio: number;
};
};
type CircularAnimationConfigExact = {
type: CircularAnimationType;
duration: number;
startingPoint: {
cx: number;
cy: number;
};
};
type FadeAnimationConfig = {
type: 'fade';
duration: number;
};
type AnimationConfig = (
| CircularAnimationConfig
| FadeAnimationConfig
| CircularAnimationConfigExact
) & {
captureType?: 'layer' | 'hierarchy';
};
interface ThemeSwitcherHookProps {
switchThemeFunction: () => void;
animationConfig?: AnimationConfig;
}
declare const switchTheme: (props: ThemeSwitcherHookProps) => void;
export {
switchTheme,
ThemeSwitcherHookProps,
AnimationConfig,
CircularAnimationConfigExact,
CircularAnimationConfig,
};