Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing types for typescript #2

Open
yangwao opened this issue Dec 25, 2019 · 6 comments
Open

Missing types for typescript #2

yangwao opened this issue Dec 25, 2019 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@yangwao
Copy link

yangwao commented Dec 25, 2019

Great work but would be doable to have types :)

image
image

@pmochine
Copy link
Contributor

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
Copy link

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

@pmochine
Copy link
Contributor

pmochine commented Jul 6, 2020

@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
Copy link

If anyone have solved this issue please share here. Thanks

@pmochine pmochine self-assigned this Sep 12, 2022
@pmochine pmochine added the enhancement New feature or request label Sep 12, 2022
@Igor-Ponso
Copy link

Igor-Ponso commented Nov 15, 2022

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!

@TarynVivino
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants