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

Convert helpers.extra to TS #10728

Merged
merged 1 commit into from
Oct 6, 2022
Merged

Conversation

etimberg
Copy link
Member

Converts the helpers.extra file to TS. I took the opportunity to simplify the throttled helper which is the breaking change

@etimberg etimberg added breaking change type: types Typescript type changes labels Sep 30, 2022
const event = args[0];
return [event, event.offsetX, event.offsetY];
});
}, chart);
Copy link
Member Author

Choose a reason for hiding this comment

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

Initially I had provided some very complex types for throttled so that we could verify the arguments to the callback function. However, this identified that we don't actually use the 2nd and 3rd parameters here so I removed the 3rd argument. That change allowed removal of the updateFn from the helper which is the breaking change

@etimberg
Copy link
Member Author

Test failure will be fixed in #10729 and then I will rebase this PR

import {_limitValue} from './helpers.math';
import {_lookupByKey} from './helpers.collection';

export function fontString(pixelSize, fontStyle, fontFamily) {
export function fontString(pixelSize: number, fontStyle: string, fontFamily: string) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we want the fontStyle types as the different types like bold, italic etc?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could. Not sure how complicated that might be given all the combinations of styles that could be supplied

Copy link
Member

Choose a reason for hiding this comment

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

probably not worth the effort

src/helpers/helpers.extras.ts Outdated Show resolved Hide resolved
@kurkle kurkle added this to the Version 4.0 milestone Oct 6, 2022
@etimberg etimberg merged commit e6892a9 into chartjs:master Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change type: types Typescript type changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants