@@ -2,7 +2,7 @@ import * as React from "react";
2
2
import { cx } from "@renderlesskit/react" ;
3
3
4
4
import { useTheme } from "../theme" ;
5
- // import { Split } from "../utils/types";
5
+ import { Split } from "../utils/types" ;
6
6
import { isFunction , objectKeys } from "../utils" ;
7
7
import { useHover , useMediaQuery } from "../hooks" ;
8
8
import { Toast , ToastPlacement , useToasts , useToastsReturnType } from "./index" ;
@@ -34,7 +34,7 @@ export type ToastsContainerProps = {
34
34
35
35
export const ToastsContainer = ( props : ToastsContainerProps ) => {
36
36
const { toasts, placement, updateHeight, calculateOffset } = props ;
37
- const [ side , position ] = placement . split ( "-" ) as any ;
37
+ const [ side , position ] = placement . split ( "-" ) as Split < typeof placement , "-" > ;
38
38
39
39
const [ isMobile ] = useMediaQuery ( "(max-width: 640px)" ) ;
40
40
const { hoverProps, isHovered } = useHover ( ) ;
@@ -113,7 +113,7 @@ export const StackableToast = (props: StackableToastProps) => {
113
113
) ;
114
114
115
115
const isToastVisible = visible ;
116
- const [ side , position ] = placement . split ( "-" ) as any ;
116
+ const [ side , position ] = placement . split ( "-" ) as Split < typeof placement , "-" > ;
117
117
const sortedIndex = toastsLength - ( index + 1 ) ;
118
118
const clampedIndex =
119
119
sortedIndex > visibleToasts ? visibleToasts : sortedIndex ;
0 commit comments