diff options
Diffstat (limited to 'cli/tsc')
-rw-r--r-- | cli/tsc/dts/lib.deno.unstable.d.ts | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index eb612a655..70b346a2a 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -1357,7 +1357,13 @@ declare namespace Deno { * mutation is applied to the key. * * - `set` - Sets the value of the key to the given value, overwriting any - * existing value. + * existing value. Optionally an `expireIn` option can be specified to + * set a time-to-live (TTL) for the key. The TTL is specified in + * milliseconds, and the key will be deleted from the database at earliest + * after the specified number of milliseconds have elapsed. Once the + * specified duration has passed, the key may still be visible for some + * additional time. If the `expireIn` option is not specified, the key will + * not expire. * - `delete` - Deletes the key from the database. The mutation is a no-op if * the key does not exist. * - `sum` - Adds the given value to the existing value of the key. Both the @@ -1379,7 +1385,7 @@ declare namespace Deno { export type KvMutation = & { key: KvKey } & ( - | { type: "set"; value: unknown } + | { type: "set"; value: unknown; expireIn?: number } | { type: "delete" } | { type: "sum"; value: KvU64 } | { type: "max"; value: KvU64 } @@ -1591,8 +1597,15 @@ declare namespace Deno { /** * 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. + * + * Optionally an `expireIn` option can be specified to set a time-to-live + * (TTL) for the key. The TTL is specified in milliseconds, and the key will + * be deleted from the database at earliest after the specified number of + * milliseconds have elapsed. Once the specified duration has passed, the + * key may still be visible for some additional time. If the `expireIn` + * option is not specified, the key will not expire. */ - set(key: KvKey, value: unknown): this; + set(key: KvKey, value: unknown, options?: { expireIn?: number }): this; /** * Add to the operation a mutation that deletes the specified key if all * checks pass during the commit. @@ -1721,8 +1734,19 @@ declare namespace Deno { * const db = await Deno.openKv(); * await db.set(["foo"], "bar"); * ``` + * + * Optionally an `expireIn` option can be specified to set a time-to-live + * (TTL) for the key. The TTL is specified in milliseconds, and the key will + * be deleted from the database at earliest after the specified number of + * milliseconds have elapsed. Once the specified duration has passed, the + * key may still be visible for some additional time. If the `expireIn` + * option is not specified, the key will not expire. */ - set(key: KvKey, value: unknown): Promise<KvCommitResult>; + set( + key: KvKey, + value: unknown, + options?: { expireIn?: number }, + ): Promise<KvCommitResult>; /** * Delete the value for the given key from the database. If no value exists |