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

Add missing animations prop to options interface. #448

Merged
merged 1 commit into from
Aug 17, 2021

Conversation

multipolygon
Copy link
Contributor

@multipolygon multipolygon commented Jul 29, 2021

@kurkle
Copy link
Member

kurkle commented Jul 29, 2021

AnimationSpec might be better type for it.

Could also pass the TType, to make the scriptable context properly typed:

interface PluginOptionsByType<TType extends ChartType> {
annotation: AnnotationPluginOptions;
}

Edit: actually the scriptable context is not same here, so maybe this comment should be ignored :)

@kurkle kurkle added the types Typescript type changes label Aug 17, 2021
@kurkle kurkle merged commit 0151838 into chartjs:master Aug 17, 2021
@@ -65,5 +65,6 @@ interface PointAnnotationOptions extends CoreAnnotationOptions {
export interface AnnotationPluginOptions extends AnnotationEvents {
annotations: AnnotationOptions[] | Record<string, AnnotationOptions>,
dblClickSpeed?: Scriptable<number, PartialEventContext>,
drawTime?: Scriptable<DrawTime, PartialEventContext>,
drawTime?: Scriptable<DrawTime, PartialEventContext>,
animations: Record<string, unknown>,
Copy link
Contributor

@jbelien jbelien Dec 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this commit, I have the following error in my project (when I try to upgrade this library):

error TS2741: Property 'animations' is missing in type '{ annotations: { [key: string]: AnnotationOptions; }; }' but required in type 'AnnotationPluginOptions'.

Shouldn't the animations property be optional ?

- animations: Record<string, unknown>,
+ animations?: Record<string, unknown>,

I don't find any documentation on this property in https://www.chartjs.org/chartjs-plugin-annotation/latest/ ; am I missing something ?

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants