Skip to content

Commit

Permalink
Improve typings
Browse files Browse the repository at this point in the history
  • Loading branch information
valamidev committed Oct 7, 2023
1 parent f5411e6 commit 75db99b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grafana-cloud-graphite",
"version": "0.3.0",
"version": "0.3.1",
"description": "NodeJS client for Grafana Cloud Graphite API",
"repository": {
"type": "git",
Expand Down
7 changes: 4 additions & 3 deletions src/handlers/metricsHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
GraphiteMetricsOptions,
IntervalMetrics,
MetricSchema,
Stats,
} from "../types";
import { GraphiteHTTP } from "./httpHandler";
import { GraphiteCounter } from "./metricTypes/counter";
Expand All @@ -26,7 +27,7 @@ export class GraphiteMetrics extends EventEmitter {
name: string,
interval: number,
tags?: Record<string, string>
) {
): Counter {
const metrics = new GraphiteCounter(
this.options.namespace ? `${this.options.namespace}.${name}` : name,
interval,
Expand All @@ -42,7 +43,7 @@ export class GraphiteMetrics extends EventEmitter {
name: string,
interval: number,
tags?: Record<string, string>
) {
): Stats {
const metrics = new GraphiteStats(
this.options.namespace ? `${this.options.namespace}.${name}` : name,
interval,
Expand All @@ -58,7 +59,7 @@ export class GraphiteMetrics extends EventEmitter {
name: string,
interval: number,
tags?: Record<string, string>
) {
): Gauge {
const metrics = new GraphiteGauge(
this.options.namespace ? `${this.options.namespace}.${name}` : name,
interval,
Expand Down
8 changes: 1 addition & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
export * from "./handlers/metricsHandler";
export {
GraphiteMetricsOptions,
Counter,
Gauge,
Stats,
Histogram,
} from "./types";
export * from "./types";

0 comments on commit 75db99b

Please sign in to comment.