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

Stricter typings #289

Open
rslawik opened this issue Apr 26, 2020 · 0 comments
Open

Stricter typings #289

rslawik opened this issue Apr 26, 2020 · 0 comments

Comments

@rslawik
Copy link
Contributor

rslawik commented Apr 26, 2020

Should we introduce stricter types for some of the properties of GoogleChart?

  • type: string could be replaced with the union of all keys (string literals) from CHART_TYPES. That would prevent typos but it would require a way to extend that union to support arbitrary visualization types (similarly to HTMLElementTagNameMap). Suggested by @rictic.

  • options: {}|undefined could be replaced with the union of all known options types from DefinitelyTyped google.visualization. For example: LineChartOptions|ColumnChartOptions.

  • cols: unknown[]|undeifned could be use DataObjectColumn

  • rows: unknown[][]|undefined could be use DataObjectRow

All those changes are likely to be breaking. We should weight the benefits they offer.

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

No branches or pull requests

1 participant