trendmicro-frontend / tonic-ui

Tonic UI is a UI component library for React, built with Emotion and Styled System. It is designed to be easy to use and easy to customize.
https://trendmicro-frontend.github.io/tonic-ui
MIT License
125 stars 28 forks source link

[Feature Request] Support Typescirpt index.d.ts file for all shared components #161

Closed ultralabed closed 2 years ago

AnupriyaSaxenas commented 4 years ago

We created types for theme in our React application that uses Typescript. Some issues are not identified by Typescript because of bracket notation. Example: theme.colors["red:20"] //This should not give a typescript error and doesn't and works as expected theme.colors["gsdfgn"] //This should give me a typescript error but doesn't The problem is we can't use keys like "red:20" without bracket notation and if we use bracket notation, typescript doesn't throw errors for any invalid values. With dot notation we get typescript errors if we try to access any random value: theme.colors.gsdfgn //This gives the typescript error and works as expected

cheton commented 2 years ago

Close this issue because we don't have resource for adding TypeScript support so far.