Skip to content

Commit

Permalink
Update types and externs docs to include gbigint
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 702761805
  • Loading branch information
Soy Authors authored and copybara-github committed Dec 4, 2024
1 parent e332e02 commit 6e064af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions documentation/dev/externs.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ Soy type | Allowed Java types
`int` | `int`\*, `java.lang.Integer`, `long`\*, `java.lang.Long` | Integer overflow throws a runtime error.
`float` | `double`\*, `java.lang.Double`, `float`\*, `java.lang.Float` |
`number` | `double`\*, `java.lang.Double`, `java.lang.Number` | `number` is an alias for `int\|float`.
`gbigint` | `java.math.BigInteger` |
`string` | `java.lang.String` |
`bool` | `boolean`*, `java.lang.Boolean` |
`Message` | `com.google.protobuf.Message` |
Expand Down
13 changes: 13 additions & 0 deletions documentation/reference/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,19 @@ Python | `float`
An alias for `int|float`. (Technically a [composite type](#union), not a
primitive.)

### `gbigint` {#gbigint}

An arbitrarily sized integer value. `gbigint` does not support math operations
without an explicit coercion.

Backend | type in host language
---------- | -------------------------------------------------------------
JavaScript | `gbigint`
SoySauce | `long`, `com.google.template.soy.data.restricted.GbigintData`
Tofu | `com.google.template.soy.data.restricted.GbigintData`

See [go/gbigint](http://go/gbigint) for more information.

### `string` {#string}

`string` is one of the most common types in Soy. In addition to plain strings
Expand Down

0 comments on commit 6e064af

Please sign in to comment.