motiondivision / motion

A modern animation library for React and JavaScript
https://motion.dev
MIT License
25.66k stars 842 forks source link

[FEATURE] Export types from motion/react to be imported in vanilla motion #2870

Open targetlucked69 opened 1 week ago

targetlucked69 commented 1 week ago

Now that Motion has a vanilla API, most of the types are only available under motion/react. Is it possible to export them under motion?

For example, you want to create your own wrapper in Svelte, you will have to import all of the ff. props in motion/react

<script lang="ts">
import type {
  DOMKeyframesDefinition,
  DynamicAnimationOptions,
  AnimationPlaybackControls,
  MotionProps // this can be used in other frameworks
} from 'motion/react' // nice if can be imported in `motion`!

const props: MotionProps = $props()
</script>
CRBroughton commented 4 days ago

Also have the same issue, happy to raise a PR for the first two types as that's what I'm after to start working with this in Vue. Should be a simple matter.