Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions ts/ngx_core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,15 @@ 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
* dictionary.
* @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.
*/
Expand All @@ -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).
Expand Down Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion ts/ngx_http_js_module.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion ts/ngx_stream_js_module.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
1 change: 1 addition & 0 deletions ts/njs_core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 11 additions & 4 deletions ts/njs_webcrypto.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ interface RsaHashedKeyGenParams {
}

interface EcKeyImportParams {
name: "ECDSA";
name: "ECDSA" | "ECDH";
namedCurve: "P-256" | "P-384" | "P-521";
}

interface EcKeyGenParams {
name: "ECDSA";
name: "ECDSA" | "ECDH";
namedCurve: "P-256" | "P-384" | "P-521";
}

Expand All @@ -68,7 +68,8 @@ type ImportAlgorithm =
| AesImportParams
| AesVariants
| "PBKDF2"
| "HKDF";
| "HKDF"
| "ECDH";

type GenerateAlgorithm =
| RsaHashedKeyGenParams
Expand Down Expand Up @@ -99,9 +100,15 @@ interface Pbkdf2Params {
interations: number;
}

interface EcdhParams {
name: "ECDH";
public: CryptoKey;
}

type DeriveAlgorithm =
| HkdfParams
| Pbkdf2Params;
| Pbkdf2Params
| EcdhParams;

interface HmacKeyGenParams {
name: "HMAC";
Expand Down