Mercurial > njs
changeset 2577:09355ab5e63a
Types: updated TS definitions.
| author | Dmitry Volyntsev <xeioex@nginx.com> |
|---|---|
| date | Mon, 16 Jun 2025 18:03:41 -0700 |
| parents | 6018de6f6c59 |
| children | cf91a31a0947 |
| files | ts/ngx_core.d.ts ts/ngx_http_js_module.d.ts ts/ngx_stream_js_module.d.ts ts/njs_core.d.ts |
| diffstat | 4 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/ts/ngx_core.d.ts Fri Jun 13 20:19:36 2025 -0700 +++ b/ts/ngx_core.d.ts Mon Jun 16 18:03:41 2025 -0700 @@ -276,6 +276,7 @@ * * @param key The key of the item to add. * @param value The value of the item to add. + * @param timeout Overrides the default timeout for this item in milliseconds. * @returns `true` if the value has been added successfully, `false` * if the `key` already exists in this dictionary. * @throws {SharedMemoryError} if there's not enough free space in this @@ -283,7 +284,7 @@ * @throws {TypeError} if the `value` is of a different type than expected * by this dictionary. */ - add(key: string, value: V): boolean; + add(key: string, value: V, timeout?: number): boolean; /** * Removes all items from this dictionary. */ @@ -307,13 +308,14 @@ * @param delta The number to increment/decrement the value by. * @param init The number to initialize the item with if it didn't exist * (default is `0`). + * @param timeout Overrides the default timeout for this item in milliseconds. * @returns The new value. * @throws {SharedMemoryError} if there's not enough free space in this * dictionary. * @throws {TypeError} if this dictionary does not expect numbers. */ incr: V extends number - ? (key: string, delta: V, init?: number) => number + ? (key: string, delta: V, init?: number, timeout?: number) => number : never; /** * @param maxCount The maximum number of pairs to retrieve (default is 1024). @@ -371,13 +373,14 @@ * * @param key The key of the item to set. * @param value The value of the item to set. + * @param timeout Overrides the default timeout for this item in milliseconds. * @returns This dictionary (for method chaining). * @throws {SharedMemoryError} if there's not enough free space in this * dictionary. * @throws {TypeError} if the `value` is of a different type than expected * by this dictionary. */ - set(key: string, value: V): this; + set(key: string, value: V, timeout?: number): this; /** * @returns The number of items in this shared dictionary. */
--- a/ts/ngx_http_js_module.d.ts Fri Jun 13 20:19:36 2025 -0700 +++ b/ts/ngx_http_js_module.d.ts Mon Jun 16 18:03:41 2025 -0700 @@ -468,7 +468,7 @@ /** * nginx variables as strings. * - * **Warning:** Bytes invalid in UTF-8 encoding may be converted into the replacement character. + * After 0.8.5 bytes invalid in UTF-8 encoding are converted into the replacement characters. * * @see rawVariables */
--- a/ts/ngx_stream_js_module.d.ts Fri Jun 13 20:19:36 2025 -0700 +++ b/ts/ngx_stream_js_module.d.ts Mon Jun 16 18:03:41 2025 -0700 @@ -200,7 +200,7 @@ /** * nginx variables as strings. * - * **Warning:** Bytes invalid in UTF-8 encoding may be converted into the replacement character. + * After 0.8.5 bytes invalid in UTF-8 encoding are converted into the replacement characters. * * @see rawVariables */
