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

FillerOptions without type beforeDraw (Typescript) #11354

Closed
GustavoMaga opened this issue Jun 17, 2023 · 0 comments · Fixed by #11358
Closed

FillerOptions without type beforeDraw (Typescript) #11354

GustavoMaga opened this issue Jun 17, 2023 · 0 comments · Fixed by #11358
Labels
type: bug type: types Typescript type changes
Milestone

Comments

@GustavoMaga
Copy link

Expected behavior

The following code is in the src/types/index.d.ts file:

export interface . {
  drawTime: 'beforeDatasetDraw' | 'beforeDatasetsDraw';
  propagate: boolean;
}

And it should be like this:

export interface . {
  drawTime: 'beforeDatasetDraw' | 'beforeDatasetsDraw' | 'beforeDraw';
  propagate: boolean;
}

Because there is a 'beforeDraw' option created but it is not being exported within the option.plugins.filler interface

Typescript return this error: Type '"beforeDraw"' cannot be assigned to type '"beforeDatasetDraw" | "beforeDatasetsDraw"'.ts(2322)

Current behavior

export interface . {
  drawTime: 'beforeDatasetDraw' | 'beforeDatasetsDraw';
  propagate: boolean;
}

Return error: Type '"beforeDraw"' cannot be assigned to type '"beforeDatasetDraw" | "beforeDatasetsDraw"'.ts(2322)

Reproducible sample

https://codepen.io/leelenaleee/pen/WNyJXEe

Optional extra steps/info to reproduce

No response

Possible solution

export interface . {
  drawTime: 'beforeDatasetDraw' | 'beforeDatasetsDraw' | 'beforeDraw';
  propagate: boolean;
}

Just add the "beforeDraw" option in the interface export.

Context

No response

chart.js version

v4.3.0

Browser name and version

No response

Link to your project

No response

@etimberg etimberg added the type: types Typescript type changes label Jun 17, 2023
@etimberg etimberg added this to the Version 4.3.1 milestone Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug type: types Typescript type changes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants