]> git.kaiwu.me - njs.git/commitdiff
Types: updated TS definitions.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 17 Jun 2025 01:03:41 +0000 (18:03 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 17 Jun 2025 05:11:38 +0000 (22:11 -0700)
ts/ngx_core.d.ts
ts/ngx_http_js_module.d.ts
ts/ngx_stream_js_module.d.ts
ts/njs_core.d.ts

index b459c92930adddde6446754551036bd5e84c205f..d35cb40f6eccb29eb8433bcde201e60e99b86a49 100644 (file)
@@ -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.
      */
index 37932893f0385b5bba4cfde2709376376d364e1f..d7dd1c9ed7d3a64afafba98a7c5a0ca1ef550981 100644 (file)
@@ -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
      */
index 58c4d90800c9e07e8d47e583c04d920a58bcf68a..c78d008b2de4a0b20f1443321102b42ad15b636e 100644 (file)
@@ -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
      */
index 2f1d45d01ff864cf1b9e010d3f63dbffa24dedb5..f64c9576cf603795690654e5fc8be308302d3ede 100644 (file)
@@ -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;