siimon / prom-client

Prometheus client for node.js
Apache License 2.0
3.15k stars 378 forks source link

Fixed types #629

Open zigazajc007 opened 7 months ago

zigazajc007 commented 7 months ago

Related to issue https://github.com/siimon/prom-client/issues/614

Registry<RegistryContentType = PrometheusContentType>

As PrometheusContentType is assigned to RegistryContentType, the typescript will automatically exclude OpenMetricsContentType from RegistryContentType in Registry. So to solve this issue, we can just manually tell typescript that provided value can be PrometheusContentType or OpenMetricsContentType.

zigazajc007 commented 7 months ago

Is this everything that is needed or do I still need to write a Changelog?

SimenB commented 7 months ago

I messed around with the lint error in #630, and I might've accidentally fixed this? Could you check? If still broken, this needs a quick rebase 🙂

zigazajc007 commented 7 months ago

Tried method in https://github.com/siimon/prom-client/pull/630 but it doesn't work.

image

I'm using typescript from Bun.

SimenB commented 5 months ago

Fair - mind rebasing? 🙂