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

Split TimeScaleOptions sub types into smaller types #11185

Closed
etimberg opened this issue Mar 9, 2023 · 2 comments · Fixed by #11187
Closed

Split TimeScaleOptions sub types into smaller types #11185

etimberg opened this issue Mar 9, 2023 · 2 comments · Fixed by #11187
Labels
type: enhancement type: types Typescript type changes

Comments

@etimberg
Copy link
Member

etimberg commented Mar 9, 2023

Feature Proposal

I am working on an integration where the existing code created the time options for the scale separately. Because there is no exposed type for this object, I had to use a work-around. It should be straightforward to create an intermediate type that is exposed

Workaround

import { type TimeScaleOptions } from 'chart.js'

const time: TimeScaleOptions['time'] = {
  unit: 'day'
}

Possible Implementation

Refactor https://github.com/chartjs/Chart.js/blob/master/src/types/index.d.ts#L3329-L3364 out into an exposed type

@etimberg etimberg added type: enhancement type: types Typescript type changes labels Mar 9, 2023
@etimberg
Copy link
Member Author

etimberg commented Mar 9, 2023

@kurkle @LeeLenaleee @dangreen @igorlukanin thoughts on this kind of change?

@LeeLenaleee
Copy link
Collaborator

Don't have any objections against it

@etimberg etimberg changed the title Split Split TimeScaleOptions sub types into smaller types Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement type: types Typescript type changes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants