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

TypeScript: xMin, xMax, yMin, yMax should accept undefined value as Scriptable options return value #921

Open
tlserver opened this issue Jan 17, 2024 · 0 comments
Labels
types Typescript type changes

Comments

@tlserver
Copy link
Contributor

The four options xMin, xMax, yMin, and yMax can accept an undefined value to indicate "growth to the chart boundary." Scriptable options for these four options also support an undefined value. However, TypeScript has incorrectly defined the types for these four options:

  xMax?: Scriptable<ScaleValue, PartialEventContext>,
  xMin?: Scriptable<ScaleValue, PartialEventContext>,
  yMax?: Scriptable<ScaleValue, PartialEventContext>,
  yMin?: Scriptable<ScaleValue, PartialEventContext>,

Using (_, __) => undefined should be a valid assignment, but currently, TypeScript raises a type error.

@stockiNail stockiNail added the types Typescript type changes label Jan 17, 2024
@tlserver tlserver changed the title Type of xMin, xMax, yMin, yMax should accept undefined value as Scriptable options return value TypeScript: xMin, xMax, yMin, yMax should accept undefined value as Scriptable options return value Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types Typescript type changes
Projects
None yet
Development

No branches or pull requests

2 participants