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

Updates to scale type definitions #11419

Merged
merged 1 commit into from
Jul 25, 2023
Merged

Conversation

joshkel
Copy link
Contributor

@joshkel joshkel commented Jul 25, 2023

While adding some type definitions to chartjs-plugin-zoom (see chartjs/chartjs-plugin-zoom#774), I noticed a few limitations in Chart.js's scale types:

  • The zoom plugin calls Scale.parse with no index parameter. Scale's JSDoc allows this, but its TypeScript definitions did not.
  • The zoom plugin alters scale options' min and max. The specific types of these depend on which scale is in use, but every scale has them, so unknown seems appropriate

While adding some type definitions to chartjs-plugin-zoom
(see chartjs/chartjs-plugin-zoom#774), I noticed
a few limitations in Chart.js's scale types:

* The zoom plugin calls `Scale.parse` with no index parameter.  Scale's
  JSDoc allows this, but its TypeScript definitions did not.
* The zoom plugin alters scale options' min and max.  The specific types
  of these depend on which scale is in use, but every scale has them, so
  `unknown` seems appropriate
@LeeLenaleee LeeLenaleee added this to the Version 4.4.0 milestone Jul 25, 2023
@LeeLenaleee LeeLenaleee added the type: types Typescript type changes label Jul 25, 2023
@etimberg etimberg merged commit dd03016 into chartjs:master Jul 25, 2023
@joshkel joshkel deleted the scale-types branch July 26, 2023 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: types Typescript type changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants