-
Notifications
You must be signed in to change notification settings - Fork 108
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
Please add TypeScript definitions #20
Comments
Hi @JannesMeyer For the wrapper? If, for the Highcharts then please refer to this issue - highcharts/highcharts#4876 |
Hi @KacperMadej ! Yes, for the props of the I see in the other issue that you are unable to provide type definitions for the Of course, the main issue is adequate typing for the |
By the way, the company I work for has a single developer license for the Highcharts Suite with the Premium Support. Let me know if you want me to email the proof of license. |
For technical support please use support channels - https://www.highcharts.com/support It would be for the best to keep issues in github for bugs - at least this it what we are trying to do. |
Ok, I have written an email to support@highcharts.com requesting this enhancement. Sorry for using the wrong channel. |
Not a problem. I'm keeping this issue open and labeled as an enhancement. |
I created a types file for my personal use; hopefully it serves as a good starting point for someone to do so more formally (whether part of the package or in DefinitelyTyped). However, some work definitely needs to be done before Highstocks and Highmaps are covered. declare module "highcharts-react-official" {
import * as React from "react";
import * as Highcharts from "highcharts";
/**
* Represents a "constructor" function for a ChartObject.
* Not technically a constructor, as it's not called with `new`.
*/
type Constructor = (
renderTo: HTMLElement,
options: Highcharts.Options,
) => Highcharts.ChartObject;
/**
* Represents all of the strings that are keys of T that map to a Constructor function.
*/
type ConstructorName<T> = {
[K in keyof T]: T[K] extends Constructor ? K : never
}[keyof T];
export interface HighchartsReactProps<TContainerProps = {}> {
highcharts?: Highcharts.Static;
constructorType?: ConstructorName<Highcharts.Static>;
update?: boolean;
options: Highcharts.Options;
containerProps?: TContainerProps;
}
export class HighchartsReact<TContainerProps = {}> extends React.Component<
HighchartsReactProps<TContainerProps>
> {}
export default HighchartsReact;
} |
See #36. Official definitions are expected in Q3. |
As specified in #36 the official definitions are only for the normal highcharts api. So we still need official definitions for highcharts-react. |
I agree with @TheJhonny007. Pull request #36 is only for the options attribute. Like I mentioned in my first comment, there would still be the need for types for the rest of the |
Sorry, I just realised that the rest of the component's types are included in the pull request. Nevermind!! |
@JannesMeyer in which pull request? #36 was rejected and closed. |
Hello! We will also work on declarations for Highcharts React. Development will start with the end of the beta phase for Highcharts declarations. |
Thank you, that was the answer that I think we all wanted. 🙂 |
Is there any ETA on this? |
No there is no ETA for this yet, because development has not started. First the Highcharts declerations have to be stable and generally available. |
I expect though that the support will be quite fast implemented, once the Highcharts declarations are leaving the beta state. |
@bre1470 thanks - my understanding for now is that I should follow the instructions @ https://github.com/highcharts/highcharts-declarations-beta plus the types from @BrandonWilliamsCS updated to use your beta types e.g. |
@jonfreedman Yes, that sounds reasonable and should help in the meantime. I just like to point out, that the beta of the Highcharts declarations is not intended for regular development use. You might have to change some code after a future beta update. |
Happy to change later but the good news is this is working right now. |
now that Highcharts 7 contains typescript definitions by default, any updates on this issue? |
@BrandonWilliamsCS this no longer works with Highcharts 7. |
@pdeva, Unfortunately, I don't use this actively use library any longer, so it won't be likely that I'll be taking a close look at v7. |
The TypeScript declarations for this wrapper have been added in verion 2.1.0. Please report in case of any problems. Best regards! |
I am seeing the following error:
See https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3.9.4 |
No description provided.
The text was updated successfully, but these errors were encountered: