[njs] Types: updated TS definitions.
noreply at nginx.com
noreply at nginx.com
Tue Jun 17 05:12:02 UTC 2025
details: https://github.com/nginx/njs/commit/dfcafd3dddbb5c28dfb25bac207e85fc6ea4a929
branches: master
commit: dfcafd3dddbb5c28dfb25bac207e85fc6ea4a929
user: Dmitry Volyntsev <xeioex at nginx.com>
date: Mon, 16 Jun 2025 18:03:41 -0700
description:
Types: updated TS definitions.
---
ts/ngx_core.d.ts | 9 ++++++---
ts/ngx_http_js_module.d.ts | 2 +-
ts/ngx_stream_js_module.d.ts | 2 +-
ts/njs_core.d.ts | 1 +
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/ts/ngx_core.d.ts b/ts/ngx_core.d.ts
index b459c929..d35cb40f 100644
--- a/ts/ngx_core.d.ts
+++ b/ts/ngx_core.d.ts
@@ -276,6 +276,7 @@ interface NgxSharedDict<V extends string | number = string | number> {
*
* @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 @@ interface NgxSharedDict<V extends string | number = string | number> {
* @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 @@ interface NgxSharedDict<V extends string | number = string | number> {
* @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 @@ interface NgxSharedDict<V extends string | number = string | number> {
*
* @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.
*/
diff --git a/ts/ngx_http_js_module.d.ts b/ts/ngx_http_js_module.d.ts
index 37932893..d7dd1c9e 100644
--- a/ts/ngx_http_js_module.d.ts
+++ b/ts/ngx_http_js_module.d.ts
@@ -468,7 +468,7 @@ interface NginxHTTPRequest {
/**
* 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
*/
diff --git a/ts/ngx_stream_js_module.d.ts b/ts/ngx_stream_js_module.d.ts
index 58c4d908..c78d008b 100644
--- a/ts/ngx_stream_js_module.d.ts
+++ b/ts/ngx_stream_js_module.d.ts
@@ -200,7 +200,7 @@ interface NginxStreamRequest {
/**
* 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
*/
diff --git a/ts/njs_core.d.ts b/ts/njs_core.d.ts
index 2f1d45d0..f64c9576 100644
--- a/ts/njs_core.d.ts
+++ b/ts/njs_core.d.ts
@@ -581,6 +581,7 @@ interface NjsProcess {
readonly env: NjsEnv;
/**
+ * Send signal to a process by its PID.
* @since 0.8.8
*/
kill(pid: number, signal?: string | number): true;
More information about the nginx-devel
mailing list