Skip to content

Commit

Permalink
chore: fix lint errors in TS file (#630)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Apr 29, 2024
1 parent 1c7a4c0 commit 564e467
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"no-shadow": "off",
"@typescript-eslint/no-shadow": "warn",
"node/no-unsupported-features/es-syntax": "off"
}
},
Expand Down
8 changes: 5 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export type RegistryContentType =
/**
* Container for all registered metrics
*/
export class Registry<RegistryContentType = PrometheusContentType> {
export class Registry<
BoundRegistryContentType extends RegistryContentType = PrometheusContentType,
> {
/**
* Get string representation for all metrics
*/
Expand Down Expand Up @@ -81,14 +83,14 @@ export class Registry<RegistryContentType = PrometheusContentType> {
/**
* Gets the Content-Type of the metrics for use in the response headers.
*/
readonly contentType: RegistryContentType;
readonly contentType: BoundRegistryContentType;

/**
* 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: BoundRegistryContentType): void;

/**
* Merge registers
Expand Down

0 comments on commit 564e467

Please sign in to comment.