Skip to content

MetricType enum not exported for use in index.js #336

Closed

Description

@biswa1shaw

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

Activity

  1. zbjornson commented on Mar 12, 2020

    @zbjornson
    Contributor

    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.

  2. sam-github commented on Mar 13, 2020

    @sam-github
    Contributor

    electron has some tooling to generate type defs from docs, might be worth looking at, some discussion recently at nodejs/node#32206

  3. LastKing commented on Jun 18, 2020

    @LastKing
    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.

  4. changed the title [-]MetricType enumnot exported for use in index.js[/-] [+]MetricType enum not exported for use in index.js[/+] on Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions