|
1 | | -import { ChartDataset } from "chart.js"; |
2 | | -import { Metric, PrometheusConnectionOptions } from "prometheus-query"; |
3 | | -export declare class PrometheusTimeRange { |
4 | | - step?: number | null; |
5 | | - minStep?: number | null; |
6 | | - msUpdateInterval?: number | null; |
7 | | -} |
8 | | -export interface PrometheusTimeRangeRelative { |
9 | | - type: 'relative'; |
10 | | - start: number; |
11 | | - end: number; |
12 | | -} |
13 | | -export interface PrometheusTimeRangeAbsolute { |
14 | | - type: 'absolute'; |
15 | | - start: Date; |
16 | | - end: Date; |
17 | | -} |
18 | | -export declare type ChartDatasourcePrometheusPluginOptionsTimeRange = PrometheusTimeRange & (PrometheusTimeRangeRelative | PrometheusTimeRangeAbsolute); |
19 | | -export declare type PrometheusQuery = string | ((start: Date, end: Date, step: number) => Promise<any>); |
20 | | -export declare type PrometheusQueries = PrometheusQuery | PrometheusQuery[]; |
21 | | -export declare type PrometheusSerieHook = (serie: Metric) => string | null; |
22 | | -export declare type DataSetHook = (datasets: ChartDataset[]) => ChartDataset[]; |
23 | | -export declare class ChartDatasourcePrometheusPluginNoDataMsg { |
24 | | - message?: string; |
25 | | - font?: string; |
26 | | - textAlign?: CanvasTextAlign; |
27 | | - textBaseline?: CanvasTextBaseline; |
28 | | - direction?: CanvasDirection; |
29 | | -} |
30 | | -export declare class ChartDatasourcePrometheusPluginErrorMsg { |
31 | | - message?: string | null; |
32 | | - font?: string; |
33 | | - textAlign?: CanvasTextAlign; |
34 | | - textBaseline?: CanvasTextBaseline; |
35 | | - direction?: CanvasDirection; |
36 | | -} |
37 | | -export declare class ChartDatasourcePrometheusPluginLoadingMsg { |
38 | | - message?: string; |
39 | | - font?: string; |
40 | | - textAlign?: CanvasTextAlign; |
41 | | - textBaseline?: CanvasTextBaseline; |
42 | | - direction?: CanvasDirection; |
43 | | -} |
44 | | -export declare class ChartDatasourcePrometheusPluginOptions { |
45 | | - /** |
46 | | - * Options for Prometheus requests |
47 | | - */ |
48 | | - prometheus: PrometheusConnectionOptions | null; |
49 | | - query: PrometheusQueries; |
50 | | - timeRange: ChartDatasourcePrometheusPluginOptionsTimeRange; |
51 | | - /** |
52 | | - * Options for designing Charts |
53 | | - * See https://learnui.design/tools/data-color-picker.html#palette |
54 | | - */ |
55 | | - fillGaps?: boolean; |
56 | | - tension?: number; |
57 | | - cubicInterpolationMode?: 'default' | 'monotone'; |
58 | | - stepped?: boolean; |
59 | | - fill?: boolean; |
60 | | - stacked?: boolean; |
61 | | - borderWidth?: number; |
62 | | - borderColor?: string[]; |
63 | | - backgroundColor?: string[]; |
64 | | - noDataMsg?: ChartDatasourcePrometheusPluginNoDataMsg; |
65 | | - errorMsg?: ChartDatasourcePrometheusPluginErrorMsg; |
66 | | - loadingMsg?: ChartDatasourcePrometheusPluginLoadingMsg; |
67 | | - findInLabelMap?: PrometheusSerieHook | null; |
68 | | - findInBorderColorMap?: PrometheusSerieHook | null; |
69 | | - findInBackgroundColorMap?: PrometheusSerieHook | null; |
70 | | - dataSetHook?: DataSetHook | null; |
71 | | - /** |
72 | | - * Compute a step for range_query (interval between 2 points in second) |
73 | | - */ |
74 | | - assertPluginOptions(): void; |
75 | | - getQueries(): PrometheusQuery[]; |
76 | | -} |
| 1 | +import { ChartDataset } from "chart.js"; |
| 2 | +import { Metric, PrometheusConnectionOptions } from "prometheus-query"; |
| 3 | +export declare class PrometheusTimeRange { |
| 4 | + step?: number | null; |
| 5 | + minStep?: number | null; |
| 6 | + msUpdateInterval?: number | null; |
| 7 | +} |
| 8 | +export interface PrometheusTimeRangeRelative { |
| 9 | + type: 'relative'; |
| 10 | + start: number; |
| 11 | + end: number; |
| 12 | +} |
| 13 | +export interface PrometheusTimeRangeAbsolute { |
| 14 | + type: 'absolute'; |
| 15 | + start: Date; |
| 16 | + end: Date; |
| 17 | +} |
| 18 | +export type ChartDatasourcePrometheusPluginOptionsTimeRange = PrometheusTimeRange & (PrometheusTimeRangeRelative | PrometheusTimeRangeAbsolute); |
| 19 | +export type PrometheusQuery = string | ((start: Date, end: Date, step: number) => Promise<any>); |
| 20 | +export type PrometheusQueries = PrometheusQuery | PrometheusQuery[]; |
| 21 | +export type PrometheusSerieHook = (serie: Metric) => string | null; |
| 22 | +export type DataSetHook = (datasets: ChartDataset[]) => ChartDataset[]; |
| 23 | +export declare class ChartDatasourcePrometheusPluginNoDataMsg { |
| 24 | + message?: string; |
| 25 | + font?: string; |
| 26 | + textAlign?: CanvasTextAlign; |
| 27 | + textBaseline?: CanvasTextBaseline; |
| 28 | + direction?: CanvasDirection; |
| 29 | +} |
| 30 | +export declare class ChartDatasourcePrometheusPluginErrorMsg { |
| 31 | + message?: string | null; |
| 32 | + font?: string; |
| 33 | + textAlign?: CanvasTextAlign; |
| 34 | + textBaseline?: CanvasTextBaseline; |
| 35 | + direction?: CanvasDirection; |
| 36 | +} |
| 37 | +export declare class ChartDatasourcePrometheusPluginLoadingMsg { |
| 38 | + message?: string; |
| 39 | + font?: string; |
| 40 | + textAlign?: CanvasTextAlign; |
| 41 | + textBaseline?: CanvasTextBaseline; |
| 42 | + direction?: CanvasDirection; |
| 43 | +} |
| 44 | +export declare class ChartDatasourcePrometheusPluginOptions { |
| 45 | + /** |
| 46 | + * Options for Prometheus requests |
| 47 | + */ |
| 48 | + prometheus: PrometheusConnectionOptions | null; |
| 49 | + query: PrometheusQueries; |
| 50 | + timeRange: ChartDatasourcePrometheusPluginOptionsTimeRange; |
| 51 | + /** |
| 52 | + * Options for designing Charts |
| 53 | + * See https://learnui.design/tools/data-color-picker.html#palette |
| 54 | + */ |
| 55 | + fillGaps?: boolean; |
| 56 | + tension?: number; |
| 57 | + cubicInterpolationMode?: 'default' | 'monotone'; |
| 58 | + stepped?: boolean; |
| 59 | + fill?: boolean; |
| 60 | + stacked?: boolean; |
| 61 | + borderWidth?: number; |
| 62 | + borderColor?: string[]; |
| 63 | + backgroundColor?: string[]; |
| 64 | + noDataMsg?: ChartDatasourcePrometheusPluginNoDataMsg; |
| 65 | + errorMsg?: ChartDatasourcePrometheusPluginErrorMsg; |
| 66 | + loadingMsg?: ChartDatasourcePrometheusPluginLoadingMsg; |
| 67 | + findInLabelMap?: PrometheusSerieHook | null; |
| 68 | + findInBorderColorMap?: PrometheusSerieHook | null; |
| 69 | + findInBackgroundColorMap?: PrometheusSerieHook | null; |
| 70 | + dataSetHook?: DataSetHook | null; |
| 71 | + /** |
| 72 | + * Compute a step for range_query (interval between 2 points in second) |
| 73 | + */ |
| 74 | + assertPluginOptions(): void; |
| 75 | + getQueries(): PrometheusQuery[]; |
| 76 | +} |
0 commit comments