import { createContext, type RefObject } from 'react'; import type { State } from 'react-native-gesture-handler'; import type { SharedValue } from 'react-native-reanimated'; import type { AnimateToPositionType, BottomSheetGestureProps, BottomSheetProps, } from '../components/bottomSheet/types'; import type { SCROLLABLE_STATUS, SHEET_STATE } from '../constants'; import type { AnimationState, DetentsState, KeyboardState, LayoutState, Scrollable, ScrollableRef, ScrollableState, } from '../types'; export interface BottomSheetInternalContextType extends Partial, Required< Pick< BottomSheetProps, | 'enableContentPanningGesture' | 'enableOverDrag' | 'enablePanDownToClose' | 'enableDynamicSizing' | 'enableBlurKeyboardOnGesture' | 'overDragResistanceFactor' > > { // animated states animatedDetentsState: SharedValue; animatedAnimationState: SharedValue; animatedSheetState: SharedValue; animatedKeyboardState: SharedValue; animatedContentGestureState: SharedValue; animatedHandleGestureState: SharedValue; animatedLayoutState: SharedValue; // scrollable animatedScrollableState: SharedValue; animatedScrollableStatus: SharedValue; // animated values animatedPosition: SharedValue; animatedIndex: SharedValue; animatedSheetHeight: SharedValue; isInTemporaryPosition: SharedValue; // methods stopAnimation: () => void; animateToPosition: AnimateToPositionType; setScrollableRef: (ref: ScrollableRef) => void; removeScrollableRef: (ref: RefObject) => void; // refs textInputNodesRef: React.MutableRefObject>; } export const BottomSheetInternalContext = createContext(null); export const BottomSheetInternalProvider = BottomSheetInternalContext.Provider;