Skip to content

Stricter typingsΒ #289

@rslawik

Description

@rslawik

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions