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

Expose a TS Generic for typing util functions #129

Closed
peduarte opened this issue Aug 25, 2020 · 1 comment
Closed

Expose a TS Generic for typing util functions #129

peduarte opened this issue Aug 25, 2020 · 1 comment
Labels
enhancement typescript TypeScript related

Comments

@peduarte
Copy link
Contributor

Curently, if I want to type a util function against a theme scale, I need to do this:

fs: () => (value: keyof typeof theme["fontSizes"] | (string & {})) => ({
      fontSize: value
}),

Would be nice to facilitate the DX here. Perhaps something like:

fs: () => (value: Theme<"fontSizes">) => ({
      fontSize: value
}),

Or something like that 🙂

@peduarte peduarte changed the title Expose a TS Genetic for typing util functions Expose a TS Generic for typing util functions Aug 25, 2020
@peduarte peduarte added typescript TypeScript related and removed priority: 3 labels Sep 18, 2020
@peduarte
Copy link
Contributor Author

peduarte commented Oct 9, 2020

@hadihallak as part of #118 can we have a think about this one too?

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

Successfully merging a pull request may close this issue.

1 participant