From 6e064afa507abba5d2d5e6a974255e6c66eafd39 Mon Sep 17 00:00:00 2001 From: Soy Authors Date: Wed, 4 Dec 2024 09:56:34 -0800 Subject: [PATCH] Update types and externs docs to include gbigint PiperOrigin-RevId: 702761805 --- documentation/dev/externs.md | 1 + documentation/reference/types.md | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/documentation/dev/externs.md b/documentation/dev/externs.md index 807f7d107..c8e15df7a 100644 --- a/documentation/dev/externs.md +++ b/documentation/dev/externs.md @@ -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` | diff --git a/documentation/reference/types.md b/documentation/reference/types.md index e9b9af031..92d4ca44e 100644 --- a/documentation/reference/types.md +++ b/documentation/reference/types.md @@ -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