forked from grafana/xk6-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.d.ts
102 lines (94 loc) · 2.21 KB
/
config.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
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
// SPDX-FileCopyrightText: 2023 Raintank, Inc. dba Grafana Labs
//
// SPDX-License-Identifier: AGPL-3.0-only
export module dashboard {
/**
* Dashboard configuration.
*/
export interface Config {
/** Dashboard title */
title: string;
/** Tab definitions */
tabs: Tab[];
}
/**
* Dashboard tab definition.
*/
export interface Tab {
/** tab id */
id: string;
/** tab title */
title: string;
/** short description */
description?: string;
/** list of panel definitions */
panels: Panel[];
/** list of chart definitions */
charts: Chart[];
/** event name, "snapshot" or "cumulative" */
event: string;
/** should the tab include in report or no */
report?: boolean;
}
/**
* Dashboard chart definition.
*/
export interface Chart {
/** chart id */
id: string;
/** chart title */
title: string;
/** series definitions */
series: Record<string, Serie>; // should be an array
/** axe definitions */
axes?: Axe[];
/** scale definitions */
scales?: Scale[];
/** chart hight, default 250 */
height?: any;
}
/** Chart data serie definition. */
export interface Serie {
/** label used in legend */
label: string;
/** scale reference */
scale?: string;
/** format used in legend */
format: string;
/** line width */
width?: number;
/** is it a rate or not */
rate?: boolean;
}
/** Chart axis definition */
export interface Axe {
/** format using in labels */
format?: string;
/** side index (0=left, 1=right) */
side?: number;
/** scale reference */
scale?: string;
}
export interface Scale {}
/** Dashboard panel definition. */
export interface Panel {
/** panel id */
id: string;
/** panel title */
title: string;
/** metric name to display */
metric: string;
/** format */
format?: string;
}
}
declare global {
interface Array<T> {
/**
* Search for an array element that has a given id property value.
* @param {string} id the id for the search
* @returns {T} the first element whose id property matches or is undefined if there are no results
*/
getById(id: string): T;
}
}