Skip to content

Commit 3b66641

Browse files
tniessenzbjornson
authored andcommitted
Add type declaration for client.contentType
Refs: #91
1 parent 074f339 commit 3b66641

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ project adheres to [Semantic Versioning](http://semver.org/).
3333

3434
### Added
3535

36+
- fix: add type declaration for `client.contentType`
37+
3638
## [13.2.0] - 2021-08-08
3739

3840
### Changed

index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ export type Collector = () => void;
7979
*/
8080
export const register: Registry;
8181

82+
/**
83+
* The Content-Type of the metrics for use in the response headers.
84+
*/
85+
export const contentType: string;
86+
8287
export class AggregatorRegistry extends Registry {
8388
/**
8489
* Gets aggregated metrics for all workers.

test/registerTest.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,11 @@ describe('register', () => {
609609
});
610610
});
611611

612+
it('should have the same contentType as the module', () => {
613+
const moduleWideContentType = require('../').contentType;
614+
expect(register.contentType).toEqual(moduleWideContentType);
615+
});
616+
612617
function getMetric(name) {
613618
name = name || 'test_metric';
614619
return {

0 commit comments

Comments
 (0)