Skip to content

Commit

Permalink
chore: updated internal types
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Nov 17, 2024
1 parent 3733862 commit 5db1d89
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React, {
memo,
useEffect,
} from 'react';
import { Platform } from 'react-native';
import { type Insets, Platform } from 'react-native';
import { State } from 'react-native-gesture-handler';
import Animated, {
useAnimatedReaction,
Expand Down Expand Up @@ -48,7 +48,7 @@ import {
useReactiveSharedValue,
useScrollable,
} from '../../hooks';
import type { BottomSheetMethods, Insets } from '../../types';
import type { BottomSheetMethods } from '../../types';
import {
animate,
getKeyboardAnimationConfigs,
Expand Down Expand Up @@ -204,7 +204,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
}, [topInset, bottomInset, $modal, _animatedContainerHeight]);
const animatedContainerOffset = useReactiveSharedValue(
_providedContainerOffset ?? INITIAL_CONTAINER_OFFSET
) as SharedValue<Insets>;
) as SharedValue<Required<Insets>>;
const animatedHandleHeight = useReactiveSharedValue<number>(
INITIAL_HANDLE_HEIGHT
);
Expand Down Expand Up @@ -388,7 +388,7 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
isInTemporaryPosition,
keyboardBehavior,
]);
const animatedScrollableState = useDerivedValue(() => {
const animatedScrollableState = useDerivedValue<SCROLLABLE_STATE>(() => {
/**
* if user had disabled content panning gesture, then we unlock
* the scrollable state.
Expand Down
2 changes: 1 addition & 1 deletion src/components/bottomSheetContainer/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface BottomSheetContainerProps
Pick<BottomSheetProps, 'topInset' | 'bottomInset' | 'detached'>
> {
containerHeight: SharedValue<number>;
containerOffset: SharedValue<Insets>;
containerOffset: SharedValue<Required<Insets>>;
shouldCalculateHeight?: boolean;
style?: StyleProp<ViewStyle>;
children?: ReactNode;
Expand Down
6 changes: 0 additions & 6 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ export type ScrollableEvent = (

//#region utils
export type Primitive = string | number | boolean;
export interface Insets {
top: number;
bottom: number;
left: number;
right: number;
}
//#endregion

//#region hooks
Expand Down

0 comments on commit 5db1d89

Please sign in to comment.