@@ -76,23 +76,23 @@ export interface Metric {
7676 * A group of related metrics loosely based on the interfaces exposed by the
7777 * prom-client module
7878 */
79- export interface MetricGroup {
79+ export interface MetricGroup < T extends string = any > {
8080 /**
8181 * Update the stored metric group to the passed value
8282 */
83- update ( values : Record < string , number > ) : void
83+ update ( values : Partial < Record < T , number > > ) : void
8484
8585 /**
8686 * Increment the metric group keys by the passed number or
87- * any non-numeric value to increment by 1
87+ * `true` to increment by 1
8888 */
89- increment ( values : Record < string , number | unknown > ) : void
89+ increment ( values : Partial < Record < T , number | true > > ) : void
9090
9191 /**
9292 * Decrement the metric group keys by the passed number or
93- * any non-numeric value to decrement by 1
93+ * `true` to decrement by 1
9494 */
95- decrement ( values : Record < string , number | unknown > ) : void
95+ decrement ( values : Partial < Record < T , number | true > > ) : void
9696
9797 /**
9898 * Reset the passed key in this metric group to its default value
@@ -128,12 +128,12 @@ export interface Counter {
128128 * exposed by the prom-client module - counters are metrics that only
129129 * go up
130130 */
131- export interface CounterGroup {
131+ export interface CounterGroup < T extends string = any > {
132132 /**
133133 * Increment the metric group keys by the passed number or
134134 * any non-numeric value to increment by 1
135135 */
136- increment ( values : Record < string , number | unknown > ) : void
136+ increment ( values : Partial < Record < T , number | true > > ) : void
137137
138138 /**
139139 * Reset the passed key in this metric group to its default value
0 commit comments