@gdacm/grafana-items 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,6 @@ export declare class BarChart extends Panel {
8
8
  constructor(metaOptions: GenericMetaOptions)
9
9
  get custom(): FieldConfigCustomBarChart;
10
10
  withCustom(code: (custom: FieldConfigCustomBarChart) => void): this
11
- setNewOptions(onNewCreated: ((item: PanelOptionsBarChart) => PanelOptionsBarChart) | undefined): this;
12
11
  withOptions(onWith: (item: PanelOptionsBarChart) => void): this;
13
12
  get options(): PanelOptionsBarChart;
14
13
  setThresholdsStyleArea(): this
@@ -10,6 +10,7 @@ import type { GenericMetaOptions } from "@gdacm/base-types";
10
10
 
11
11
  export declare class Dashboard extends GrafanaItem {
12
12
  setAnnotations(annotations: Annotations): this;
13
+ setNewAnnotations(onNewCreated: ((item: Annotations) => Annotations) | undefined): this;
13
14
  withAnnotations(onWith: (item: Annotations) => void): this;
14
15
  get annotations(): Annotations;
15
16
  setEditable(editable: Boolean): this;
@@ -31,13 +32,16 @@ export declare class Dashboard extends GrafanaItem {
31
32
  setRefresh(refresh: String): this;
32
33
  setTags(tags: Array<String>): this;
33
34
  setTemplating(templating: Templating): this;
35
+ setNewTemplating(onNewCreated: ((item: Templating) => Templating) | undefined): this;
34
36
  withTemplating(onWith: (item: Templating) => void): this;
35
37
  get templating(): Templating;
36
38
  setTime(time: TimeRange): this;
39
+ setNewTime(onNewCreated: ((item: TimeRange) => TimeRange) | undefined): this;
37
40
  withTime(onWith: (item: TimeRange) => void): this;
38
41
  get time(): TimeRange;
39
42
  setTimeRange(from: string, to: string): this;
40
43
  setTimepicker(timepicker: TimePicker): this;
44
+ setNewTimepicker(onNewCreated: ((item: TimePicker) => TimePicker) | undefined): this;
41
45
  withTimepicker(onWith: (item: TimePicker) => void): this;
42
46
  get timepicker(): TimePicker;
43
47
  setTimezone(timezone: String): this;
@@ -6,6 +6,7 @@ import type { GenericMetaOptions } from "@gdacm/base-types";
6
6
 
7
7
  export declare class FieldConfig extends GrafanaItem {
8
8
  setDefaults(defaults: FieldConfigDefault): this;
9
+ setNewDefaults(onNewCreated: ((item: FieldConfigDefault) => FieldConfigDefault) | undefined): this;
9
10
  withDefaults(onWith: (item: FieldConfigDefault) => void): this;
10
11
  get defaults(): FieldConfigDefault;
11
12
  initOverrides(): this;
@@ -21,10 +21,12 @@ export declare class FieldConfigCustomBarChart extends FieldConfigCustom {
21
21
  setFillOpacity(fillOpacity: Number): this;
22
22
  setGradientMode(gradientMode: String): this;
23
23
  setHideFrom(hideFrom: HideFrom): this;
24
+ setNewHideFrom(onNewCreated: ((item: HideFrom) => HideFrom) | undefined): this;
24
25
  withHideFrom(onWith: (item: HideFrom) => void): this;
25
26
  get hideFrom(): HideFrom;
26
27
  setLineWidth(lineWidth: Number): this;
27
28
  setThresholdsStyle(thresholdsStyle: ThresholdStyle): this;
29
+ setNewThresholdsStyle(onNewCreated: ((item: ThresholdStyle) => ThresholdStyle) | undefined): this;
28
30
  withThresholdsStyle(onWith: (item: ThresholdStyle) => void): this;
29
31
  get thresholdsStyle(): ThresholdStyle;
30
32
  setThresholdsStyleMode(mode: string): this;
@@ -5,6 +5,7 @@ import type { GenericMetaOptions } from "@gdacm/base-types";
5
5
 
6
6
  export declare class FieldConfigCustomGeomap extends FieldConfigCustom {
7
7
  setHideFrom(hideFrom: HideFrom): this;
8
+ setNewHideFrom(onNewCreated: ((item: HideFrom) => HideFrom) | undefined): this;
8
9
  withHideFrom(onWith: (item: HideFrom) => void): this;
9
10
  get hideFrom(): HideFrom;
10
11
  }
@@ -0,0 +1,11 @@
1
+ import { FieldConfigCustom } from "./FieldConfigCustom.js";
2
+ import { HideFrom } from "./HideFrom.js";
3
+
4
+ import type { GenericMetaOptions } from "@gdacm/base-types";
5
+
6
+ export declare class FieldConfigCustomPieChart extends FieldConfigCustom {
7
+ setHideFrom(hideFrom: HideFrom): this;
8
+ setNewHideFrom(onNewCreated: ((item: HideFrom) => HideFrom) | undefined): this;
9
+ withHideFrom(onWith: (item: HideFrom) => void): this;
10
+ get hideFrom(): HideFrom;
11
+ }
@@ -7,9 +7,11 @@ import type { GenericMetaOptions } from "@gdacm/base-types";
7
7
  export declare class FieldConfigCustomTable extends FieldConfigCustom {
8
8
  setAlign(align: String): this;
9
9
  setCellOptions(cellOptions: FieldConfigCustomTableCellOptions): this;
10
+ setNewCellOptions(onNewCreated: ((item: FieldConfigCustomTableCellOptions) => FieldConfigCustomTableCellOptions) | undefined): this;
10
11
  withCellOptions(onWith: (item: FieldConfigCustomTableCellOptions) => void): this;
11
12
  get cellOptions(): FieldConfigCustomTableCellOptions;
12
13
  setFooter(footer: FieldConfigCustomTableFooter): this;
14
+ setNewFooter(onNewCreated: ((item: FieldConfigCustomTableFooter) => FieldConfigCustomTableFooter) | undefined): this;
13
15
  withFooter(onWith: (item: FieldConfigCustomTableFooter) => void): this;
14
16
  get footer(): FieldConfigCustomTableFooter;
15
17
  setInspect(inspect: Boolean): this;
@@ -29,11 +29,13 @@ export declare class FieldConfigCustomTimeSerie extends FieldConfigCustom {
29
29
  setFillOpacity(fillOpacity: Number): this;
30
30
  setGradientMode(gradientMode: String): this;
31
31
  setHideFrom(hideFrom: HideFrom): this;
32
+ setNewHideFrom(onNewCreated: ((item: HideFrom) => HideFrom) | undefined): this;
32
33
  withHideFrom(onWith: (item: HideFrom) => void): this;
33
34
  get hideFrom(): HideFrom;
34
35
  setInsertNulls(insertNulls: Boolean): this;
35
36
  setLineInterpolation(lineInterpolation: String): this;
36
37
  setLineStyle(lineStyle: LineStyle): this;
38
+ setNewLineStyle(onNewCreated: ((item: LineStyle) => LineStyle) | undefined): this;
37
39
  withLineStyle(onWith: (item: LineStyle) => void): this;
38
40
  get lineStyle(): LineStyle;
39
41
  setLineStyleFill(fill: string): this;
@@ -45,9 +47,11 @@ export declare class FieldConfigCustomTimeSerie extends FieldConfigCustom {
45
47
  setShowValues(showValues: Boolean): this;
46
48
  setSpanNulls(spanNulls: Boolean): this;
47
49
  setStacking(stacking: Stacking): this;
50
+ setNewStacking(onNewCreated: ((item: Stacking) => Stacking) | undefined): this;
48
51
  withStacking(onWith: (item: Stacking) => void): this;
49
52
  get stacking(): Stacking;
50
53
  setThresholdsStyle(thresholdsStyle: ThresholdStyle): this;
54
+ setNewThresholdsStyle(onNewCreated: ((item: ThresholdStyle) => ThresholdStyle) | undefined): this;
51
55
  withThresholdsStyle(onWith: (item: ThresholdStyle) => void): this;
52
56
  get thresholdsStyle(): ThresholdStyle;
53
57
  setThresholdsStyleMode(mode: string): this;
@@ -12,6 +12,7 @@ export declare class FieldConfigDefault extends GrafanaItem {
12
12
  withColor(onWith: (item: Color) => void): this;
13
13
  get color(): Color;
14
14
  setCustom(custom: FieldConfigCustom): this;
15
+ setNewCustom(onNewCreated: ((item: FieldConfigCustom) => FieldConfigCustom) | undefined): this;
15
16
  withCustom(onWith: (item: FieldConfigCustom) => void): this;
16
17
  get custom(): FieldConfigCustom;
17
18
  setDecimals(decimals: Number): this;
@@ -24,6 +25,7 @@ export declare class FieldConfigDefault extends GrafanaItem {
24
25
  setMax(max: Number): this;
25
26
  setMin(min: Number): this;
26
27
  setThresholds(thresholds: Thresholds): this;
28
+ setNewThresholds(onNewCreated: ((item: Thresholds) => Thresholds) | undefined): this;
27
29
  withThresholds(onWith: (item: Thresholds) => void): this;
28
30
  get thresholds(): Thresholds;
29
31
  setUnit(unit: String): this;
@@ -8,7 +8,6 @@ export declare class Gauge extends Panel {
8
8
  constructor(metaOptions: GenericMetaOptions)
9
9
  get custom(): FieldConfigCustomGauge;
10
10
  withCustom(code: (custom: FieldConfigCustomGauge) => void): this
11
- setNewOptions(onNewCreated: ((item: PanelOptionsGauge) => PanelOptionsGauge) | undefined): this;
12
11
  withOptions(onWith: (item: PanelOptionsGauge) => void): this;
13
12
  get options(): PanelOptionsGauge;
14
13
  }
@@ -8,7 +8,6 @@ export declare class Geomap extends Panel {
8
8
  constructor(metaOptions: GenericMetaOptions)
9
9
  get custom(): FieldConfigCustomGeomap;
10
10
  withCustom(code: (custom: FieldConfigCustomGeomap) => void): this
11
- setNewOptions(onNewCreated: ((item: PanelOptionsGeomap) => PanelOptionsGeomap) | undefined): this;
12
11
  withOptions(onWith: (item: PanelOptionsGeomap) => void): this;
13
12
  get options(): PanelOptionsGeomap;
14
13
  }
@@ -15,4 +15,7 @@ export declare class GrafanaItem {
15
15
  _setObject<T>(key: string, value: T): this;
16
16
  _getObject<T>(key: string): T;
17
17
  _withObject<T>(key: string, code: (item: T) => void): this;
18
+ _setGrafanaObject<T extends GrafanaItem>(key: string, type: new (metaOptions: GenericMetaOptions) => T, value: T | undefined): this;
19
+ _getGrafanaObject<T extends GrafanaItem>(key: string, type: new (metaOptions: GenericMetaOptions) => T): T;
20
+ _withGrafanaObject<T extends GrafanaItem>(key: string, type: new (metaOptions: GenericMetaOptions) => T, code: (item: T) => void): this;
18
21
  }
@@ -11,10 +11,12 @@ import type { GenericMetaOptions } from "@gdacm/base-types";
11
11
  export declare class Panel extends GrafanaItem {
12
12
  setCacheTimeout(cacheTimeout: String): this;
13
13
  setDatasource(datasource: Datasource): this;
14
+ setNewDatasource(onNewCreated: ((item: Datasource) => Datasource) | undefined): this;
14
15
  withDatasource(onWith: (item: Datasource) => void): this;
15
16
  get datasource(): Datasource;
16
17
  setDescription(description: String): this;
17
18
  setFieldConfig(fieldConfig: FieldConfig): this;
19
+ setNewFieldConfig(onNewCreated: ((item: FieldConfig) => FieldConfig) | undefined): this;
18
20
  withFieldConfig(onWith: (item: FieldConfig) => void): this;
19
21
  get fieldConfig(): FieldConfig;
20
22
  setGridPos(gridPos: GridPos): this;
@@ -33,6 +35,7 @@ export declare class Panel extends GrafanaItem {
33
35
  setMaxDataPoints(maxDataPoints: Number): this;
34
36
  setMaxPerRow(maxPerRow: Number): this;
35
37
  setOptions(options: Object): this;
38
+ setNewOptions(onNewCreated: ((item: Object) => Object) | undefined): this;
36
39
  withOptions(onWith: (item: Object) => void): this;
37
40
  get options(): Object;
38
41
  setPluginVersion(pluginVersion: String): this;
@@ -12,15 +12,18 @@ export declare class PanelOptionsBarChart extends PanelOptions {
12
12
  setFullHighlight(fullHighlight: Boolean): this;
13
13
  setGroupWidth(groupWidth: Number): this;
14
14
  setLegend(legend: VizLegendOptions): this;
15
+ setNewLegend(onNewCreated: ((item: VizLegendOptions) => VizLegendOptions) | undefined): this;
15
16
  withLegend(onWith: (item: VizLegendOptions) => void): this;
16
17
  get legend(): VizLegendOptions;
17
18
  setOrientation(orientation: String): this;
18
19
  setShowValue(showValue: String): this;
19
20
  setStacking(stacking: String): this;
20
21
  setText(text: VizTextDisplayOptions): this;
22
+ setNewText(onNewCreated: ((item: VizTextDisplayOptions) => VizTextDisplayOptions) | undefined): this;
21
23
  withText(onWith: (item: VizTextDisplayOptions) => void): this;
22
24
  get text(): VizTextDisplayOptions;
23
25
  setTooltip(tooltip: VizTooltipOptions): this;
26
+ setNewTooltip(onNewCreated: ((item: VizTooltipOptions) => VizTooltipOptions) | undefined): this;
24
27
  withTooltip(onWith: (item: VizTooltipOptions) => void): this;
25
28
  get tooltip(): VizTooltipOptions;
26
29
  setXField(xField: String): this;
@@ -5,7 +5,6 @@ import type { GenericMetaOptions } from "@gdacm/base-types";
5
5
 
6
6
  export declare class PanelOptionsGeomapBasemap extends GrafanaItem {
7
7
  setConfig(config: Object): this;
8
- setNewConfig(onNewCreated: ((item: Object) => Object) | undefined): this;
9
8
  withConfig(onWith: (item: Object) => void): this;
10
9
  get config(): Object;
11
10
  setName(name: String): this;
@@ -10,22 +10,28 @@ import type { GenericMetaOptions } from "@gdacm/base-types";
10
10
 
11
11
  export declare class PanelOptionsGeomapLayerConfigStyle extends GrafanaItem {
12
12
  setColor(color: StyleColor): this;
13
+ setNewColor(onNewCreated: ((item: StyleColor) => StyleColor) | undefined): this;
13
14
  withColor(onWith: (item: StyleColor) => void): this;
14
15
  get color(): StyleColor;
15
16
  setOpacity(opacity: Number): this;
16
17
  setRotation(rotation: StyleRotation): this;
18
+ setNewRotation(onNewCreated: ((item: StyleRotation) => StyleRotation) | undefined): this;
17
19
  withRotation(onWith: (item: StyleRotation) => void): this;
18
20
  get rotation(): StyleRotation;
19
21
  setSize(size: StyleSize): this;
22
+ setNewSize(onNewCreated: ((item: StyleSize) => StyleSize) | undefined): this;
20
23
  withSize(onWith: (item: StyleSize) => void): this;
21
24
  get size(): StyleSize;
22
25
  setSymbol(symbol: StyleSymbol): this;
26
+ setNewSymbol(onNewCreated: ((item: StyleSymbol) => StyleSymbol) | undefined): this;
23
27
  withSymbol(onWith: (item: StyleSymbol) => void): this;
24
28
  get symbol(): StyleSymbol;
25
29
  setSymbolAlign(symbolAlign: StyleSymbolAlign): this;
30
+ setNewSymbolAlign(onNewCreated: ((item: StyleSymbolAlign) => StyleSymbolAlign) | undefined): this;
26
31
  withSymbolAlign(onWith: (item: StyleSymbolAlign) => void): this;
27
32
  get symbolAlign(): StyleSymbolAlign;
28
33
  setTextConfig(textConfig: StyleTextConfig): this;
34
+ setNewTextConfig(onNewCreated: ((item: StyleTextConfig) => StyleTextConfig) | undefined): this;
29
35
  withTextConfig(onWith: (item: StyleTextConfig) => void): this;
30
36
  get textConfig(): StyleTextConfig;
31
37
  }
@@ -0,0 +1,23 @@
1
+ import { PanelOptions } from "./PanelOptions.js";
2
+ import { PieChartLegendOptions } from "./PieChartLegendOptions.js";
3
+ import { VizTooltipOptions } from "./VizTooltipOptions.js";
4
+
5
+ import type { GenericMetaOptions } from "@gdacm/base-types";
6
+
7
+ export declare class PanelOptionsPieChart extends PanelOptions {
8
+ initDisplayLabels(): this;
9
+ get displayLabels(): String[];
10
+ addDisplayLabel(displayLabel: String): this;
11
+ addNewDisplayLabel(onNewCreated: (item: String) => String): this;
12
+ withDisplayLabels(onWith: (displayLabels: String[]) => void): this;
13
+ setLegend(legend: PieChartLegendOptions): this;
14
+ setNewLegend(onNewCreated: ((item: PieChartLegendOptions) => PieChartLegendOptions) | undefined): this;
15
+ withLegend(onWith: (item: PieChartLegendOptions) => void): this;
16
+ get legend(): PieChartLegendOptions;
17
+ setPieType(pieType: String): this;
18
+ setSort(sort: String): this;
19
+ setTooltip(tooltip: VizTooltipOptions): this;
20
+ setNewTooltip(onNewCreated: ((item: VizTooltipOptions) => VizTooltipOptions) | undefined): this;
21
+ withTooltip(onWith: (item: VizTooltipOptions) => void): this;
22
+ get tooltip(): VizTooltipOptions;
23
+ }
@@ -5,6 +5,7 @@ import type { GenericMetaOptions } from "@gdacm/base-types";
5
5
 
6
6
  export declare class PanelOptionsText extends PanelOptions {
7
7
  setCode(code: PanelOptionsTextCode): this;
8
+ setNewCode(onNewCreated: ((item: PanelOptionsTextCode) => PanelOptionsTextCode) | undefined): this;
8
9
  withCode(onWith: (item: PanelOptionsTextCode) => void): this;
9
10
  get code(): PanelOptionsTextCode;
10
11
  setContent(content: String): this;
@@ -7,10 +7,12 @@ import type { GenericMetaOptions } from "@gdacm/base-types";
7
7
  export declare class PanelOptionsTimeSeries extends PanelOptions {
8
8
  setDisableKeyboardEvents(disableKeyboardEvents: Boolean): this;
9
9
  setLegend(legend: VizLegendOptions): this;
10
+ setNewLegend(onNewCreated: ((item: VizLegendOptions) => VizLegendOptions) | undefined): this;
10
11
  withLegend(onWith: (item: VizLegendOptions) => void): this;
11
12
  get legend(): VizLegendOptions;
12
13
  setOrientation(orientation: String): this;
13
14
  setTooltip(tooltip: VizTooltipOptions): this;
15
+ setNewTooltip(onNewCreated: ((item: VizTooltipOptions) => VizTooltipOptions) | undefined): this;
14
16
  withTooltip(onWith: (item: VizTooltipOptions) => void): this;
15
17
  get tooltip(): VizTooltipOptions;
16
18
  }
@@ -0,0 +1,13 @@
1
+ import { Panel } from "./Panel.js";
2
+ import { FieldConfigCustomPieChart } from "./FieldConfigCustomPieChart.js";
3
+ import { PanelOptionsPieChart } from "./PanelOptionsPieChart.js";
4
+
5
+ import type { GenericMetaOptions } from "@gdacm/base-types";
6
+
7
+ export declare class PieChart extends Panel {
8
+ constructor(metaOptions: GenericMetaOptions)
9
+ get custom(): FieldConfigCustomPieChart;
10
+ withCustom(code: (custom: FieldConfigCustomPieChart) => void): this
11
+ withOptions(onWith: (item: PanelOptionsPieChart) => void): this;
12
+ get options(): PanelOptionsPieChart;
13
+ }
@@ -0,0 +1,12 @@
1
+ import { VizLegendOptions } from "./VizLegendOptions.js";
2
+
3
+
4
+ import type { GenericMetaOptions } from "@gdacm/base-types";
5
+
6
+ export declare class PieChartLegendOptions extends VizLegendOptions {
7
+ initValues(): this;
8
+ get values(): String[];
9
+ addValue(value: String): this;
10
+ addNewValue(onNewCreated: (item: String) => String): this;
11
+ withValues(onWith: (values: String[]) => void): this;
12
+ }
@@ -8,7 +8,6 @@ export declare class Stat extends Panel {
8
8
  constructor(metaOptions: GenericMetaOptions)
9
9
  get custom(): FieldConfigCustomStat;
10
10
  withCustom(code: (custom: FieldConfigCustomStat) => void): this
11
- setNewOptions(onNewCreated: ((item: PanelOptionsStat) => PanelOptionsStat) | undefined): this;
12
11
  withOptions(onWith: (item: PanelOptionsStat) => void): this;
13
12
  get options(): PanelOptionsStat;
14
13
  }
@@ -8,7 +8,6 @@ export declare class Table extends Panel {
8
8
  constructor(metaOptions: GenericMetaOptions)
9
9
  get custom(): FieldConfigCustomTable;
10
10
  withCustom(code: (custom: FieldConfigCustomTable) => void): this
11
- setNewOptions(onNewCreated: ((item: PanelOptionsTable) => PanelOptionsTable) | undefined): this;
12
11
  withOptions(onWith: (item: PanelOptionsTable) => void): this;
13
12
  get options(): PanelOptionsTable;
14
13
  }
@@ -8,7 +8,6 @@ export declare class TextPanel extends Panel {
8
8
  constructor(metaOptions: GenericMetaOptions)
9
9
  get custom(): FieldConfigCustomText;
10
10
  withCustom(code: (custom: FieldConfigCustomText) => void): this
11
- setNewOptions(onNewCreated: ((item: PanelOptionsText) => PanelOptionsText) | undefined): this;
12
11
  withOptions(onWith: (item: PanelOptionsText) => void): this;
13
12
  get options(): PanelOptionsText;
14
13
  }
@@ -8,7 +8,6 @@ export declare class TimeSeries extends Panel {
8
8
  constructor(metaOptions: GenericMetaOptions)
9
9
  get custom(): FieldConfigCustomTimeSerie;
10
10
  withCustom(code: (custom: FieldConfigCustomTimeSerie) => void): this
11
- setNewOptions(onNewCreated: ((item: PanelOptionsTimeSeries) => PanelOptionsTimeSeries) | undefined): this;
12
11
  withOptions(onWith: (item: PanelOptionsTimeSeries) => void): this;
13
12
  get options(): PanelOptionsTimeSeries;
14
13
  setThresholdsStyleArea(): this
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gdacm/grafana-items",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "author": "gissehel",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -30,7 +30,7 @@
30
30
  "update": "node updateTypes.js"
31
31
  },
32
32
  "dependencies": {
33
- "@gdacm/base-types": "^0.1.16"
33
+ "@gdacm/base-types": "^0.1.18"
34
34
  },
35
35
  "devDependencies": {
36
36
  "chokidar-cli": "^3.0.0",