Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid TypeScript generated for maps with long integer keys with forceLong=long #717

Closed
roboslone opened this issue Dec 7, 2022 · 2 comments

Comments

@roboslone
Copy link
Contributor

Original proto:

message Message {
    map<uint64, double> field = 1;
}

Options:

  - enumsAsLiterals=true
  - env=browser
  - forceLong=long
  - oneof=unions
  - outputServices=nice-grpc,outputServices=generic-definitions
  - unrecognizedEnum=false
  - useDate=false

Generated code:

export interface Message {
  field: { [key: Long]: number }; // TS1268: An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type.
}
@stephenh
Copy link
Owner

stephenh commented Dec 8, 2022

Hi @roboslone , I believe this is a duplicate of #708 ? There is a suggested approach in that issue if you'd like to take a crack at fixing this. Thanks!

@roboslone
Copy link
Contributor Author

Yep, definitely a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants