Skip to content

Commit

Permalink
docs: add useJsTypeOverride to README (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
dasco144 committed Apr 30, 2024
1 parent 7da4233 commit 577def4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.markdown
Expand Up @@ -305,6 +305,8 @@ Generated code will be placed in the Gradle build directory.

The default behavior is `forceLong=number`, which will internally still use the `long` library to encode/decode values on the wire (so you will still see a `util.Long = Long` line in your output), but will convert the `long` values to `number` automatically for you. Note that a runtime error is thrown if, while doing this conversion, a 64-bit value is larger than can be correctly stored as a `number`.

- With `--ts_proto_opt=useJsTypeOverride`, 64-bit numbers will be ouput as the [FieldOption.JSType](https://protobuf.dev/reference/java/api-docs/com/google/protobuf/DescriptorProtos.FieldOptions.JSType) specified on the field. This takes precendence over the `forceLong` option provided.

- With `--ts_proto_opt=esModuleInterop=true` changes output to be `esModuleInterop` compliant.

Specifically the `Long` imports will be generated as `import Long from 'long'` instead of `import * as Long from 'long'`.
Expand Down

0 comments on commit 577def4

Please sign in to comment.