diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2023-04-26 13:14:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-26 17:14:01 +0000 |
commit | 2df6db36c85c27d424d54e9c168ef4ea09c5c08c (patch) | |
tree | 024397ceb470657f34def26cc938d54af950fb21 /cli/tsc/dts | |
parent | 55a9977c6252a38fac721ad789df0c7e8acf33c9 (diff) |
feat(ext/kv): add more atomic operation helpers (#18854)
Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Luca Casonato <hello@lcas.dev>
Diffstat (limited to 'cli/tsc/dts')
-rw-r--r-- | cli/tsc/dts/lib.deno.unstable.d.ts | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index cf6cedf41..dc3bfcfc0 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -1646,7 +1646,8 @@ declare namespace Deno { * - `sum` - Adds the given value to the existing value of the key. Both the * value specified in the mutation, and any existing value must be of type * `Deno.KvU64`. If the key does not exist, the value is set to the given - * value (summed with 0). + * value (summed with 0). If the result of the sum overflows an unsigned + * 64-bit integer, the result is wrapped around. * - `max` - Sets the value of the key to the maximum of the existing value * and the given value. Both the value specified in the mutation, and any * existing value must be of type `Deno.KvU64`. If the key does not exist, @@ -1845,10 +1846,24 @@ declare namespace Deno { */ mutate(...mutations: KvMutation[]): this; /** - * Shortcut for creating a sum mutation. + * Shortcut for creating a `sum` mutation. This method wraps `n` in a + * {@linkcode Deno.KvU64}, so the value of `n` must be in the range + * `[0, 2^64-1]`. */ sum(key: KvKey, n: bigint): this; /** + * Shortcut for creating a `min` mutation. This method wraps `n` in a + * {@linkcode Deno.KvU64}, so the value of `n` must be in the range + * `[0, 2^64-1]`. + */ + min(key: KvKey, n: bigint): this; + /** + * Shortcut for creating a `max` mutation. This method wraps `n` in a + * {@linkcode Deno.KvU64}, so the value of `n` must be in the range + * `[0, 2^64-1]`. + */ + max(key: KvKey, n: bigint): this; + /** * Add to the operation a mutation that sets the value of the specified key * to the specified value if all checks pass during the commit. */ |