google-chart
google-chart copied to clipboard
Stricter typings
Should we introduce stricter types for some of the properties of GoogleChart?
-
type: stringcould be replaced with the union of all keys (string literals) fromCHART_TYPES. That would prevent typos but it would require a way to extend that union to support arbitrary visualization types (similarly toHTMLElementTagNameMap). Suggested by @rictic. -
options: {}|undefinedcould be replaced with the union of all known options types from DefinitelyTyped google.visualization. For example:LineChartOptions|ColumnChartOptions. -
cols: unknown[]|undeifnedcould be useDataObjectColumn -
rows: unknown[][]|undefinedcould be useDataObjectRow
All those changes are likely to be breaking. We should weight the benefits they offer.