swup / js-plugin

A swup plugin for managing animations in JS  🎞
https://swup.js.org/plugins/js-plugin
MIT License
23 stars 5 forks source link

[Bug]: Types for `from` and `to` are too restrictive #36

Open hirasso opened 7 months ago

hirasso commented 7 months ago

What did you expect? 🧐

I'd expect from and to to accept any value compatible to path-to-regexp:

What actually happened? 😵‍💫

Only string is accepted, otherwise TypeScript complains

Solution

Use the type Path exported by swup for the types.

Swup and plugin versions 📝

current versions

What browsers are you seeing the problem on? 🧭

No response

Relevant log output 🀓

No response

URL to minimal reproduction 🔗

n/a

Checked all these? 📚