import { expectTypeOf } from "expect-type"; import type { Component, JSX } from "solid-js"; import type { Variants } from "motion-dom"; import { AnimatePresence, Presence, motion, type MotionComponent, type MotionComponentProps, type MotionProps, } from "../index.ts"; declare const isOpen: () => boolean; type CardProps = { title: string; class?: string; }; declare const Card: Component; const MotionCard = motion.create(Card); const variants: Variants = { closed: { opacity: 0, y: 16 }, open: () => ({ opacity: 1, y: 0 }), }; expectTypeOf(motion.div).toMatchTypeOf>(); expectTypeOf(motion.svg).toMatchTypeOf>(); expectTypeOf(MotionCard).toMatchTypeOf>(); expectTypeOf(Presence).toEqualTypeOf(AnimatePresence); expectTypeOf["animate"]>().toMatchTypeOf< MotionProps["animate"] >(); expectTypeOf["style"]>().toMatchTypeOf(); expectTypeOf().toMatchTypeOf(); expectTypeOf( , ).toMatchTypeOf(); expectTypeOf( , ).toMatchTypeOf(); expectTypeOf( ({ opacity: isOpen() ? 1 : 0, x: isOpen() ? 0 : -24, })} />, ).toMatchTypeOf(); expectTypeOf( , ).toMatchTypeOf(); expectTypeOf( , ).toMatchTypeOf(); expectTypeOf( , ).toMatchTypeOf(); expectTypeOf( ({ opacity: isOpen() ? 1 : 0 })} />, ).toMatchTypeOf(); expectTypeOf( , ).toMatchTypeOf(); // @ts-expect-error href is not a valid div prop. ; // @ts-expect-error intrinsic SVG path props should stay SVG-specific. ; // @ts-expect-error custom components should keep their required props. ; // @ts-expect-error custom components should reject props outside their public surface. ;