import { ReactNode } from "react";
import Animated from "react-native-reanimated";

export type AnimatedValue = Animated.SharedValue<number>;

export type GestureCtxType = {
  startX: number;
  startY: number;
};

export type AnimationType = "fade" | "slide" | "scale" | "none";

export type ModalType = "top" | "bottom" | "left" | "right" | "center";

export type LayoutType = {
  x: number;
  y: number;
  width: number;
  height: number;
};

export type ModalProps = {
  key?: string;
  offset?: number;
  visible?: boolean;
  fullsize?: boolean;
  disableGesture?: boolean;
  disableSwipeDismiss?: boolean;
  disableBackdropDismiss?: boolean;

  children?:
    | ReactNode
    | ((event: any, renderHandle: (c: ReactNode) => ReactNode) => ReactNode);
  childrenScroll?: boolean;

  overlayColor?: string;
  modalType?: ModalType;
  animationType?: AnimationType;

  onBack?: () => void;
  onOpen?: () => void;
  onOpened?: () => void;
  onClose?: () => void;
  onClosed?: () => void;
  renderOverlay?: () => any;
};

export type ModalPortalProps = any;

export type ModalPortalState = {
  stack: Array<ModalProps>;
};
