hyperweb-io / hyperweb-io/telescope

generating map types with uint64 keys yields uncompilable typescript

Open
#633 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
154
Forks
53
PR merge metrics
No merged PRs in 30d

Description

when generating proto code that has type of

`map` telescope generates uncompilable typescript. map key types can only be a `Number` type.

example here:

https://github.com/technicallyty/telescope-test/blob/4a69452e6587c1a0de70069dd774a227cf4adfde/src/codegen/cosmos/auth/v1beta1/auth.ts#L124

that line produces an error:
![image](https://github.com/user-attachments/assets/461f3327-a0ee-45d6-ace8-d1dcba18e7f3)

this is the message it generated from:

```protobuf
message Foo {
map bar = 1;
}
```

docs [here](https://github.com/cosmology-tech/telescope?tab=readme-ov-file#typings-and-formating) say we can use long or bigint for 64 bit integer types, however neither type is valid when used in a map as key.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.