Repository navigation
Expand file tree
/
Copy pathMaps.d.ts
More file actions
147 lines (147 loc) · 5.64 KB
/
Copy pathMaps.d.ts
File metadata and controls
147 lines (147 loc) · 5.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/**
* React integration.
* Copyright (c) 2026, Highsoft
*
* A valid license is required for using this software.
* See highcharts.com/license
*
* Built for Highcharts v13.1.1.
* Build stamp: 2026-10-12
*
*/
import React from "react";
import HC from "highcharts/es-modules/masters/highmaps.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;
};
/** Type for the <Chart /> options prop. */
export type ChartOptions = HC.Options;
/** Union of every series type available in the loaded Highcharts modules. */
export type SeriesType = HC.SeriesOptionsType["type"];
/** Options of a given series type, without the `type` key itself. */
export type SeriesOptions<K extends SeriesType = SeriesType> = {
[T in K]: Omit<Extract<HC.SeriesOptionsType, {
type: T;
}>, "type">;
}[K];
type SeriesFieldValue<K extends SeriesType, F extends "id" | "index" | "name" | "type" | "className" | "color" | "events" | "data"> = K extends unknown ? F extends keyof SeriesOptions<K> ? SeriesOptions<K>[F] extends undefined ? never : SeriesOptions<K>[F] : never : never;
/**
* Props of a series component: the most common options of the series type
* `K` as direct props, plus `options` for everything else.
*/
export type SeriesProps<K extends SeriesType = "line"> = {
[F in "id" | "index" | "name" | "type" | "className" | "color" | "events" | "data" as SeriesFieldValue<K, F> extends never ? never : F]?: SeriesFieldValue<K, F>;
} & {
type?: K;
options?: SeriesOptions<K>;
};
/** Shape of the object exposed through the chart component `ref`. */
export interface HighchartsReactRefObject {
chart: Highcharts.Chart;
container: HTMLDivElement;
}
/** Props shared by every chart component. */
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?: ChartOptions;
/** Constructor to use */
chartConstructor?: "chart" | "stockChart" | "ganttChart" | "mapChart";
/** Converts React elements to static HTML strings. Uses built-in renderer if not provided. */
renderToHTML?: (element: unknown) => string;
/** Children */
children?: React.ReactNode;
/** Links to Highcharts.Options.title.text */
title?: string;
/** Links to Highcharts.Options.subtitle.text */
subtitle?: string;
/** Links to Highcharts.Options.caption.text */
caption?: string;
/** Links to Highcharts.Options.credits.text */
credits?: string;
/** Links to Highcharts.Options.chart.type */
type?: string;
/** Links to Highcharts.Options.chart.height */
height?: number | string;
/** Links to Highcharts.Options.chart.width */
width?: number | string;
/** Links to Highcharts.Options.chart.inverted */
inverted?: boolean;
/** Links to Highcharts.Options.chart.animation */
animation?: boolean | object;
/** Links to Highcharts.Options.chart.styledMode */
styledMode?: boolean;
/** Links to Highcharts.Options.chart.backgroundColor */
backgroundColor?: string;
/** Links to Highcharts.Options.chart.borderColor */
borderColor?: string;
/** Links to Highcharts.Options.chart.borderWidth */
borderWidth?: number;
/** Links to Highcharts.Options.chart.margin */
margin?: number | number[];
/** Links to Highcharts.Options.chart.spacing */
spacing?: number | number[];
/** Links to Highcharts.Options.colors */
colors?: string[];
/** Links to Highcharts.Options.dataTable */
dataTable?: ChartOptions["dataTable"];
}
/**
* The chart container for Highcharts Maps. Renders a map from the GeoJSON or
* TopoJSON passed to the series `mapData`.
*
* Declare the series as children, either with a dedicated component such as
* `MapSeries` or with the generic `MapsSeries`, and configure the chart with
* option components such as `Title` or `Tooltip`. Options passed through the
* `options` prop are merged in first, direct props next, and children last.
*
* @example
* import { MapsChart } from '@highcharts/react/Maps';
* import { Title } from '@highcharts/react';
* import { MapSeries } from '@highcharts/react/series/Map';
*
* <MapsChart>
* <Title>Population by region</Title>
* <MapSeries data={values} options={{ mapData: topology }} />
* </MapsChart>
*
* @see https://www.highcharts.com/docs/react/components/chart
*/
export declare const MapsChart: React.ForwardRefExoticComponent<Omit<ICommonAttributes, "ref"> & React.RefAttributes<unknown>>;
/**
* A chart series whose type is set with the `type` prop.
*
* For a fixed type, prefer a dedicated component such as `MapSeries` for the
* best autocomplete. Reach for `MapsSeries` when the type is dynamic, e.g.
* `<MapsSeries type={type} data={data} />`. For full type safety on advanced
* settings, pass them through the `options` prop.
*
* @example
* import { MapsSeries } from '@highcharts/react/Maps';
*
* <MapsSeries type="map" data={values} />
*/
export declare function MapsSeries<K extends SeriesType = SeriesType>(props: SeriesProps<K>): any;
export declare namespace MapsSeries {
var type: string;
}
export default MapsChart;