Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed types #629

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* Container for all registered metrics
*/
export class Registry<RegistryContentType = PrometheusContentType> {

Check warning on line 24 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS ubuntu-latest

'RegistryContentType' is already declared in the upper scope on line 17 column 13

Check warning on line 24 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS macOS-latest

'RegistryContentType' is already declared in the upper scope on line 17 column 13

Check warning on line 24 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS ubuntu-latest

'RegistryContentType' is already declared in the upper scope on line 17 column 13

Check warning on line 24 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS ubuntu-latest

'RegistryContentType' is already declared in the upper scope on line 17 column 13

Check warning on line 24 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS ubuntu-latest

'RegistryContentType' is already declared in the upper scope on line 17 column 13

Check warning on line 24 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS macOS-latest

'RegistryContentType' is already declared in the upper scope on line 17 column 13

Check warning on line 24 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS macOS-latest

'RegistryContentType' is already declared in the upper scope on line 17 column 13

Check warning on line 24 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS macOS-latest

'RegistryContentType' is already declared in the upper scope on line 17 column 13

Check warning on line 24 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS windows-latest

'RegistryContentType' is already declared in the upper scope on line 17 column 13

Check warning on line 24 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS windows-latest

'RegistryContentType' is already declared in the upper scope on line 17 column 13

Check warning on line 24 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS windows-latest

'RegistryContentType' is already declared in the upper scope on line 17 column 13

Check warning on line 24 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS windows-latest

'RegistryContentType' is already declared in the upper scope on line 17 column 13
/**
* Get string representation for all metrics
*/
Expand Down Expand Up @@ -81,14 +81,16 @@
/**
* Gets the Content-Type of the metrics for use in the response headers.
*/
readonly contentType: RegistryContentType;
readonly contentType: PrometheusContentType | OpenMetricsContentType;

/**
* Set the content type of a registry. Used to change between Prometheus and
* OpenMetrics versions.
* @param contentType The type of the registry
*/
setContentType(contentType: RegistryContentType): void;
setContentType(
contentType: PrometheusContentType | OpenMetricsContentType,
): void;

/**
* Merge registers
Expand Down Expand Up @@ -148,7 +150,7 @@
* `registry.getMetricsAsJSON()`.
* @return {Registry} aggregated registry.
*/
static aggregate<T extends RegistryContentType>(

Check warning on line 153 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS ubuntu-latest

'T' is already declared in the upper scope on line 135 column 2

Check warning on line 153 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS macOS-latest

'T' is already declared in the upper scope on line 135 column 2

Check warning on line 153 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS ubuntu-latest

'T' is already declared in the upper scope on line 135 column 2

Check warning on line 153 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS ubuntu-latest

'T' is already declared in the upper scope on line 135 column 2

Check warning on line 153 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS ubuntu-latest

'T' is already declared in the upper scope on line 135 column 2

Check warning on line 153 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS macOS-latest

'T' is already declared in the upper scope on line 135 column 2

Check warning on line 153 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS macOS-latest

'T' is already declared in the upper scope on line 135 column 2

Check warning on line 153 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS macOS-latest

'T' is already declared in the upper scope on line 135 column 2

Check warning on line 153 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS windows-latest

'T' is already declared in the upper scope on line 135 column 2

Check warning on line 153 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS windows-latest

'T' is already declared in the upper scope on line 135 column 2

Check warning on line 153 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS windows-latest

'T' is already declared in the upper scope on line 135 column 2

Check warning on line 153 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS windows-latest

'T' is already declared in the upper scope on line 135 column 2
metricsArr: Array<object>,
): Registry<T>; // TODO Promise?

Expand Down Expand Up @@ -183,7 +185,7 @@
*/
export type Aggregator = 'omit' | 'sum' | 'first' | 'min' | 'max' | 'average';

export enum MetricType {

Check warning on line 188 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS ubuntu-latest

'MetricType' is already declared in the upper scope on line 188 column 13

Check warning on line 188 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS macOS-latest

'MetricType' is already declared in the upper scope on line 188 column 13

Check warning on line 188 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS ubuntu-latest

'MetricType' is already declared in the upper scope on line 188 column 13

Check warning on line 188 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS ubuntu-latest

'MetricType' is already declared in the upper scope on line 188 column 13

Check warning on line 188 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS ubuntu-latest

'MetricType' is already declared in the upper scope on line 188 column 13

Check warning on line 188 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS macOS-latest

'MetricType' is already declared in the upper scope on line 188 column 13

Check warning on line 188 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS macOS-latest

'MetricType' is already declared in the upper scope on line 188 column 13

Check warning on line 188 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS macOS-latest

'MetricType' is already declared in the upper scope on line 188 column 13

Check warning on line 188 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS windows-latest

'MetricType' is already declared in the upper scope on line 188 column 13

Check warning on line 188 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS windows-latest

'MetricType' is already declared in the upper scope on line 188 column 13

Check warning on line 188 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS windows-latest

'MetricType' is already declared in the upper scope on line 188 column 13

Check warning on line 188 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS windows-latest

'MetricType' is already declared in the upper scope on line 188 column 13
Counter,
Gauge,
Histogram,
Expand Down Expand Up @@ -392,7 +394,7 @@
* @return Function to invoke when timer should be stopped. The value it
* returns is the timed duration.
*/
startTimer(labels?: LabelValues<T>): (labels?: LabelValues<T>) => number;

Check warning on line 397 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 397 column 13

Check warning on line 397 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS macOS-latest

'labels' is already declared in the upper scope on line 397 column 13

Check warning on line 397 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 397 column 13

Check warning on line 397 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 397 column 13

Check warning on line 397 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 397 column 13

Check warning on line 397 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS macOS-latest

'labels' is already declared in the upper scope on line 397 column 13

Check warning on line 397 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS macOS-latest

'labels' is already declared in the upper scope on line 397 column 13

Check warning on line 397 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS macOS-latest

'labels' is already declared in the upper scope on line 397 column 13

Check warning on line 397 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS windows-latest

'labels' is already declared in the upper scope on line 397 column 13

Check warning on line 397 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS windows-latest

'labels' is already declared in the upper scope on line 397 column 13

Check warning on line 397 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS windows-latest

'labels' is already declared in the upper scope on line 397 column 13

Check warning on line 397 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS windows-latest

'labels' is already declared in the upper scope on line 397 column 13

/**
* Return the child for given labels
Expand Down Expand Up @@ -506,7 +508,7 @@
* @return Function to invoke when timer should be stopped. The value it
* returns is the timed duration.
*/
startTimer(labels?: LabelValues<T>): (labels?: LabelValues<T>) => number;

Check warning on line 511 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 511 column 13

Check warning on line 511 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS macOS-latest

'labels' is already declared in the upper scope on line 511 column 13

Check warning on line 511 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 511 column 13

Check warning on line 511 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 511 column 13

Check warning on line 511 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 511 column 13

Check warning on line 511 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS macOS-latest

'labels' is already declared in the upper scope on line 511 column 13

Check warning on line 511 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS macOS-latest

'labels' is already declared in the upper scope on line 511 column 13

Check warning on line 511 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS macOS-latest

'labels' is already declared in the upper scope on line 511 column 13

Check warning on line 511 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS windows-latest

'labels' is already declared in the upper scope on line 511 column 13

Check warning on line 511 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS windows-latest

'labels' is already declared in the upper scope on line 511 column 13

Check warning on line 511 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS windows-latest

'labels' is already declared in the upper scope on line 511 column 13

Check warning on line 511 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS windows-latest

'labels' is already declared in the upper scope on line 511 column 13

/**
* Start a timer with exemplar. Calling the returned function will observe the duration in
Expand All @@ -519,7 +521,7 @@
startTimer(
labels?: LabelValues<T>,
exemplarLabels?: LabelValues<T>,
): (labels?: LabelValues<T>, exemplarLabels?: LabelValues<T>) => number;

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 522 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS ubuntu-latest

'exemplarLabels' is already declared in the upper scope on line 523 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS macOS-latest

'labels' is already declared in the upper scope on line 522 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS macOS-latest

'exemplarLabels' is already declared in the upper scope on line 523 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 522 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS ubuntu-latest

'exemplarLabels' is already declared in the upper scope on line 523 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 522 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS ubuntu-latest

'exemplarLabels' is already declared in the upper scope on line 523 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 522 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS ubuntu-latest

'exemplarLabels' is already declared in the upper scope on line 523 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS macOS-latest

'labels' is already declared in the upper scope on line 522 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS macOS-latest

'exemplarLabels' is already declared in the upper scope on line 523 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS macOS-latest

'labels' is already declared in the upper scope on line 522 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS macOS-latest

'exemplarLabels' is already declared in the upper scope on line 523 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS macOS-latest

'labels' is already declared in the upper scope on line 522 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS macOS-latest

'exemplarLabels' is already declared in the upper scope on line 523 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS windows-latest

'labels' is already declared in the upper scope on line 522 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS windows-latest

'exemplarLabels' is already declared in the upper scope on line 523 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS windows-latest

'labels' is already declared in the upper scope on line 522 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS windows-latest

'exemplarLabels' is already declared in the upper scope on line 523 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS windows-latest

'labels' is already declared in the upper scope on line 522 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS windows-latest

'exemplarLabels' is already declared in the upper scope on line 523 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS windows-latest

'labels' is already declared in the upper scope on line 522 column 3

Check warning on line 524 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS windows-latest

'exemplarLabels' is already declared in the upper scope on line 523 column 3

/**
* Reset histogram values
Expand Down Expand Up @@ -626,7 +628,7 @@
* @param labels Object with label keys and values
* @return Function to invoke when timer should be stopped
*/
startTimer(labels?: LabelValues<T>): (labels?: LabelValues<T>) => number;

Check warning on line 631 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 631 column 13

Check warning on line 631 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS macOS-latest

'labels' is already declared in the upper scope on line 631 column 13

Check warning on line 631 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 631 column 13

Check warning on line 631 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 631 column 13

Check warning on line 631 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS ubuntu-latest

'labels' is already declared in the upper scope on line 631 column 13

Check warning on line 631 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS macOS-latest

'labels' is already declared in the upper scope on line 631 column 13

Check warning on line 631 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS macOS-latest

'labels' is already declared in the upper scope on line 631 column 13

Check warning on line 631 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS macOS-latest

'labels' is already declared in the upper scope on line 631 column 13

Check warning on line 631 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v21.x and OS windows-latest

'labels' is already declared in the upper scope on line 631 column 13

Check warning on line 631 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v16.x and OS windows-latest

'labels' is already declared in the upper scope on line 631 column 13

Check warning on line 631 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v18.x and OS windows-latest

'labels' is already declared in the upper scope on line 631 column 13

Check warning on line 631 in index.d.ts

View workflow job for this annotation

GitHub Actions / Test on Node.js v20.x and OS windows-latest

'labels' is already declared in the upper scope on line 631 column 13

/**
* Reset all values in the summary
Expand Down
Loading