forked from carbon-design-system/carbon-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BaseChart.d.ts
63 lines (56 loc) · 1.37 KB
/
BaseChart.d.ts
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
/// <reference types="svelte" />
import { SvelteComponentTyped } from "svelte";
import { Chart as BC } from "@carbon/charts/chart";
import type {
BaseChartOptions,
ChartTabularData,
} from "@carbon/charts/interfaces";
export interface BaseChartProps<Chart = BC, ChartOptions = BaseChartOptions, ChartData = ChartTabularData>
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["div"]> {
/**
* Provide a Carbon chart class to instantiate
* @default undefined
*/
Chart?: Chart;
/**
* Obtain a reference to the instantiated chart
* @default null
*/
chart?: null | Chart;
/**
* Set the chart data using the tabular data format
* @default []
*/
data?: ChartData;
/**
* Set the chart options
* @default {}
*/
options?: ChartOptions;
/**
* Specify the id for the chart holder element
* @default "chart-" + Math.random().toString(36)
*/
id?: string;
/**
* Obtain a reference to the chart holder element
* @default null
*/
ref?: null | HTMLDivElement;
}
export default class BaseChart<
Chart = BC,
ChartOptions = BaseChartOptions,
ChartData = ChartTabularData
> extends SvelteComponentTyped<
BaseChartProps<Chart, ChartOptions, ChartData>,
{
load: CustomEvent<Chart>;
update: CustomEvent<{
data: ChartTabularData;
options: ChartOptions;
}>;
destroy: CustomEvent<any>;
},
{}
> {}