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

Add @types/Glightbox #405

Open
tomasvn opened this issue Feb 20, 2023 · 13 comments
Open

Add @types/Glightbox #405

tomasvn opened this issue Feb 20, 2023 · 13 comments

Comments

@tomasvn
Copy link
Contributor

tomasvn commented Feb 20, 2023

Please describe the feature you want to be implemented.

Add types for the package

@gingerchew
Copy link
Collaborator

Hey there @tomasvn

Currently, adding things like types or other typescript adjacent things isn't a high priority.

That said, if you are able to get the ball rolling, I'd be more than happy to help out/check your work.

@tomasvn
Copy link
Contributor Author

tomasvn commented Feb 20, 2023

@gingerchew Hi, I am not that well versed in TS, but I can try it.

@gingerchew
Copy link
Collaborator

If you want, we can start at creating types/interface for the config object (I imagine that's what people would want typing for the most) and then work from there.

@tomasvn
Copy link
Contributor Author

tomasvn commented Feb 21, 2023

@gingerchew this is my draft for DefinitelyTyped package or the types should be here in the main repo?

TS playground

@gingerchew
Copy link
Collaborator

That's a good question, I'm leaning towards just adding an index.d.ts file to the root. @biati-digital what are your thoughts?

@gingerchew
Copy link
Collaborator

@gingerchew this is my draft for DefinitelyTyped package or the types should be here in the main repo?

TS playground

The typescript in the link you gave looks good to me, I wonder if there's a way to get the types from Plyr so that we don't need to constantly update our own in parallel. (This may be wishful thinking though)

@tomasvn
Copy link
Contributor Author

tomasvn commented Feb 21, 2023

Install plyr types as peerDep? So plyr options could be imported?

@gingerchew
Copy link
Collaborator

gingerchew commented Mar 3, 2023

I couldn't find a @types package for plyr or a .d.ts file. So we may be in between a rock and a hard place.

I'm also leaning away from peerDeps, I see them causing more trouble than benefit (maybe biased by personal experience.)

@tomasvn
Copy link
Contributor Author

tomasvn commented Mar 4, 2023

I did find them, but it seems that is has different options https://github.com/sampotts/plyr/blob/master/src/js/plyr.d.ts

#411 - Draft PR

@gingerchew
Copy link
Collaborator

You can actually pass the plyr config to glightbox,the ones documented here are just the ones you're most likely to use.

@rokozeit
Copy link

rokozeit commented May 3, 2023

Hi, I am rather new to Angular and TypeScript. I found this library and it is exactly what I need. However, for using it I would need the types. Can you tell me if this is provided soon or give me some information on how to include the types definition into a Angular project?

@tomasvn
Copy link
Contributor Author

tomasvn commented May 3, 2023

@rokozeit There is an opened PR that is still in progress

@gingerchew
Copy link
Collaborator

@rokozeit #411 you can find our WIP pr here. what is there should cover you or at least give you a reasonable head start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants