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 for TS #15

Open
rmariuzzo opened this issue Aug 6, 2020 · 2 comments · May be fixed by #22
Open

Add types for TS #15

rmariuzzo opened this issue Aug 6, 2020 · 2 comments · May be fixed by #22

Comments

@rmariuzzo
Copy link

rmariuzzo commented Aug 6, 2020

I would like to use this library in a TS project and have typings.

@rmariuzzo
Copy link
Author

rmariuzzo commented Aug 6, 2020

I added some definitions that looks promising:
image

The typing definition looks like this:

declare module 'styled-media-helper' {
  export default <M extends string>(media: Record<M, number>): {
    up: (media: M) => string
    down: (media: M) => string
    between: (mediaMin: M, mediaMax: M) => string
    only: (media: M) => string
  } => {}
}

@fleg
Copy link
Contributor

fleg commented Aug 7, 2020

PR are welcome

@Fedeorlandau Fedeorlandau linked a pull request Oct 12, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants