vue-responsive-video-background-player icon indicating copy to clipboard operation
vue-responsive-video-background-player copied to clipboard

Missing types for typescript

Open yangwao opened this issue 5 years ago • 6 comments

Great work but would be doable to have types :)

image image

yangwao avatar Dec 25 '19 14:12 yangwao

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?

pmochine avatar Dec 30 '19 10:12 pmochine

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

MarcusMLarsson avatar Jul 05 '20 11:07 MarcusMLarsson

@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

pmochine avatar Jul 06 '20 07:07 pmochine

If anyone have solved this issue please share here. Thanks

ijatinrathi avatar Aug 05 '22 18:08 ijatinrathi

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:

  • 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!

  • create the .d.ts file in src/ Screenshot 2022-11-14 213339

  • Import in my component and use it as doc says Screenshot 2022-11-14 213611

  • Declare the module and name it Screenshot 2022-11-14 213626

  • Ta-da!

  • Screenshot 2022-11-14 213849

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!

Igor-Ponso avatar Nov 15 '22 00:11 Igor-Ponso

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!!!!!!

TarynVivino avatar Apr 18 '23 19:04 TarynVivino