UNPKG

@highcharts/react

Version:
67 lines (66 loc) 2.08 kB
/** * React integration. * Copyright (c) 2025, Highsoft * * A valid license is required for using this software. * See highcharts.com/license * * Built for Highcharts v.xx. * Build stamp: 2025-09-30 * */ import React from "react"; import HC from "highcharts/esm/highcharts.src.js"; export declare let Highcharts: typeof HC; type LoggerType = { logLevel: "silent" | "debug"; log(...content: any[]): void; }; export declare const Logger: LoggerType; /** * Sets the global Highcharts reference. * * If no argument is provided, resets Highcharts to the default instance. */ export declare function setHighcharts(newHC?: typeof HC): void; /** * Returns the current global Highcharts reference. * */ export declare function getHighcharts(): typeof HC & { __provided?: boolean; }; export type HighchartsOptionsType = HC.Options; export type WithoutType<T> = Omit<T, "type">; export interface ICommonSeriesAttributes { type?: HC.SeriesOptionsType["type"]; data?: number[] | Object; options?: WithoutType<HC.SeriesOptionsType>; } export interface HighchartsReactRefObject { chart: Highcharts.Chart; container: HTMLDivElement; } export interface ICommonAttributes { /** Reference to the chart object. */ ref?: React.Ref<HighchartsReactRefObject>; containerProps?: React.HTMLAttributes<HTMLDivElement>; highcharts?: typeof HC; /** Options override - applied first, other props are merged in. */ options?: HighchartsOptionsType; /** Constructor to use */ chartConstructor?: "chart" | "stockChart" | "ganttChart" | "mapChart"; /** Children */ children?: React.ReactNode; /** Links to Highcharts.Options.title.text */ title?: string; } export declare const Chart: React.ForwardRefExoticComponent<Omit<ICommonAttributes, "ref"> & React.RefAttributes<unknown>>; export interface SeriesProps extends ICommonSeriesAttributes { type: HC.SeriesOptionsType["type"]; } export declare function Series(props: SeriesProps): any; export declare namespace Series { var type: string; } export default Chart;