avidofood / vue-responsive-video-background-player

Play your own videos in background responsively in different resolutions.
https://avidofood.github.io/vue-responsive-video-background-player/
MIT License
292 stars 36 forks source link

Missing types for typescript #2

Open yangwao opened 4 years ago

yangwao commented 4 years ago

Great work but would be doable to have types :)

image image

pmochine commented 4 years ago

Hey @yangwao ! Thank you first, however, I haven't had the time to learn TypeScript. So actually I'm quite confused, how I can add a declaration file! I looked up in StackOverflow, but it's quite confusing 🙈Any tips for me?

MarcusMLarsson commented 4 years ago

I have this exact problem. Any tips how to solve this :)?

pmochine commented 4 years ago

@MarcusMLarsson I really don't know since I don't find the time to learn typescript. But perhaps this post helps you: https://stackoverflow.com/questions/47848778/parameter-implicitly-has-an-any-type/47848779

ijatinrathi commented 2 years ago

If anyone have solved this issue please share here. Thanks

Igor-Ponso commented 1 year ago

If anyone have solved this issue please share here. Thanks

Hi, guys. How are you doing?

So. I'm not sure if I did it in the right way but I was able to make normal usage by doing the following:

and voilá. Works like a charm.

I'm using Vue 3 with Vite.

Really hope this works and helps someone!

PS - The only thing that was not working for me is use TypeScript Path Alias. So instead of src="@/assets/video/bg-video.mp4" it only works with src="/src/assets/videos/bg-video.mp4"

Hope helps someone!

TarynVivino commented 1 year ago

Hi, guys. How are you doing?

So. I'm not sure if I did it in the right way but I was able to make normal usage by doing the following:

  • Installed package as documentation says. (I'm using yarn for this project)
  • imported as a component import VideoBackground from "vue-responsive-video-background-player";
  • created a .d.ts file (inside src/) named 'responsive-video-background.d.ts' with only one line of code in it declare module "vue-responsive-video-background-player"

and voilá. Works like a charm.

I'm using Vue 3 with Vite.

Really hope this works and helps someone!

Yes! Your solution above absolutely works. Thanks for sharing!!!!!!