prom-client
prom-client copied to clipboard
MetricType enum not exported for use in index.js
Using MetricType enum in typescript like MetricType.Counter gives error after transpilation
type: prom_client_1.MetricType.Gauge
^
TypeError: Cannot read property 'Gauge' of undefined
That's a pair of bug in the TypeScript definitions (there is no such object to go along with the enum definition, and the type property where that enum would supposedly be used is a string). Thanks for reporting.
electron has some tooling to generate type defs from docs, might be worth looking at, some discussion recently at https://github.com/nodejs/node/issues/32206
export enum MetricType {
Counter,
Gauge,
Histogram,
Summary,
}
These code just just declare in index.d.ts , not real exsist in index.js , I'm confused.
I use it in my code throw error when run app.
MetricType.xxx not exsist..
Can you export real enum ( just like enum,Maybe it's an object ) or delete the declare?
My Englisth is poor. thank you.