@valkey/valkey-glide 2.0.1 → 2.1.0-rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,17 +4,17 @@
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
6
  export const enum Level {
7
- Debug = 3,
8
- Error = 0,
9
- Info = 2,
10
- Trace = 4,
11
- Warn = 1,
12
- Off = 5,
7
+ Debug = 3,
8
+ Error = 0,
9
+ Info = 2,
10
+ Trace = 4,
11
+ Warn = 1,
12
+ Off = 5
13
13
  }
14
- export const MAX_REQUEST_ARGS_LEN: number;
15
- export const DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS: number;
16
- export const DEFAULT_CONNECTION_TIMEOUT_IN_MILLISECONDS: number;
17
- export const DEFAULT_INFLIGHT_REQUESTS_LIMIT: number;
14
+ export const MAX_REQUEST_ARGS_LEN: number
15
+ export const DEFAULT_REQUEST_TIMEOUT_IN_MILLISECONDS: number
16
+ export const DEFAULT_CONNECTION_TIMEOUT_IN_MILLISECONDS: number
17
+ export const DEFAULT_INFLIGHT_REQUESTS_LIMIT: number
18
18
  /**
19
19
  * Configuration for OpenTelemetry integration in the Node.js client.
20
20
  *
@@ -26,12 +26,12 @@ export const DEFAULT_INFLIGHT_REQUESTS_LIMIT: number;
26
26
  * At least one of traces or metrics must be provided.
27
27
  */
28
28
  export interface OpenTelemetryConfig {
29
- /** Optional configuration for exporting trace data. If `None`, trace data will not be exported. */
30
- traces?: OpenTelemetryTracesConfig;
31
- /** Optional configuration for exporting metrics data. If `None`, metrics data will not be exported. */
32
- metrics?: OpenTelemetryMetricsConfig;
33
- /** Optional interval in milliseconds between consecutive exports of telemetry data. If `None`, the default `DEFAULT_FLUSH_SIGNAL_INTERVAL_MS` will be used. */
34
- flushIntervalMs?: number;
29
+ /** Optional configuration for exporting trace data. If `None`, trace data will not be exported. */
30
+ traces?: OpenTelemetryTracesConfig
31
+ /** Optional configuration for exporting metrics data. If `None`, metrics data will not be exported. */
32
+ metrics?: OpenTelemetryMetricsConfig
33
+ /** Optional interval in milliseconds between consecutive exports of telemetry data. If `None`, the default `DEFAULT_FLUSH_SIGNAL_INTERVAL_MS` will be used. */
34
+ flushIntervalMs?: number
35
35
  }
36
36
  /**
37
37
  * Configuration for exporting OpenTelemetry traces.
@@ -45,14 +45,14 @@ export interface OpenTelemetryConfig {
45
45
  * It is recommended to keep this number low (1-5%) in production environments unless you have specific needs for higher sampling rates.
46
46
  */
47
47
  export interface OpenTelemetryTracesConfig {
48
- /** The endpoint to which trace data will be exported. */
49
- endpoint: string;
50
- /**
51
- * The percentage of requests to sample and create a span for, used to measure command duration. If `None`, a default value DEFAULT_TRACE_SAMPLE_PERCENTAGE will be used.
52
- * Note: There is a tradeoff between sampling percentage and performance. Higher sampling percentages will provide more detailed telemetry data but will impact performance.
53
- * It is recommended to keep this number low (1-5%) in production environments unless you have specific needs for higher sampling rates.
54
- */
55
- samplePercentage?: number;
48
+ /** The endpoint to which trace data will be exported. */
49
+ endpoint: string
50
+ /**
51
+ * The percentage of requests to sample and create a span for, used to measure command duration. If `None`, a default value DEFAULT_TRACE_SAMPLE_PERCENTAGE will be used.
52
+ * Note: There is a tradeoff between sampling percentage and performance. Higher sampling percentages will provide more detailed telemetry data but will impact performance.
53
+ * It is recommended to keep this number low (1-5%) in production environments unless you have specific needs for higher sampling rates.
54
+ */
55
+ samplePercentage?: number
56
56
  }
57
57
  /**
58
58
  * Configuration for exporting OpenTelemetry metrics.
@@ -63,69 +63,48 @@ export interface OpenTelemetryTracesConfig {
63
63
  * - For file exporter: `file:///absolute/path/to/folder/file.json`
64
64
  */
65
65
  export interface OpenTelemetryMetricsConfig {
66
- /** The endpoint to which metrics data will be exported. */
67
- endpoint: string;
66
+ /** The endpoint to which metrics data will be exported. */
67
+ endpoint: string
68
68
  }
69
- export declare function StartSocketConnection(): Promise<string>;
70
- export declare function InitOpenTelemetry(
71
- openTelemetryConfig: OpenTelemetryConfig,
72
- ): void;
73
- export declare function log(
74
- logLevel: Level,
75
- logIdentifier: string,
76
- message: string,
77
- ): void;
78
- export declare function InitInternalLogger(
79
- level?: Level | undefined | null,
80
- fileName?: string | undefined | null,
81
- ): Level;
82
- export declare function valueFromSplitPointer(
83
- highBits: number,
84
- lowBits: number,
85
- stringDecoder: boolean,
86
- ):
87
- | null
88
- | string
89
- | Uint8Array
90
- | number
91
- | {}
92
- | Boolean
93
- | BigInt
94
- | Set<any>
95
- | any[]
96
- | Buffer;
69
+ export declare function StartSocketConnection(): Promise<string>
70
+ export declare function InitOpenTelemetry(openTelemetryConfig: OpenTelemetryConfig): void
71
+ export declare function log(logLevel: Level, logIdentifier: string, message: string): void
72
+ export declare function InitInternalLogger(level?: Level | undefined | null, fileName?: string | undefined | null): Level
73
+ export declare function valueFromSplitPointer(highBits: number, lowBits: number, stringDecoder: boolean): null | string | Uint8Array | number | {} | Boolean | BigInt | Set<any> | any[] | Buffer
97
74
  /**
98
75
  * @internal @test
99
76
  * This function is for tests that require a value allocated on the heap.
100
77
  * Should NOT be used in production.
101
78
  */
102
- export declare function createLeakedStringVec(
103
- message: Array<Uint8Array>,
104
- ): [number, number];
79
+ export declare function createLeakedStringVec(message: Array<Uint8Array>): [number, number]
105
80
  /** Creates an open telemetry span with the given name and returns a pointer to the span */
106
- export declare function createLeakedOtelSpan(name: string): [number, number];
107
- export declare function dropOtelSpan(spanPtr: bigint): void;
108
- export declare function getStatistics(): object;
81
+ export declare function createLeakedOtelSpan(name: string): [number, number]
82
+ export declare function dropOtelSpan(spanPtr: bigint): void
83
+ export declare function getStatistics(): object
109
84
  export declare class AsyncClient {
110
- static CreateConnection(connectionAddress: string): AsyncClient;
111
- get(key: string): Promise<string | Buffer | null>;
112
- set(key: string, value: string): Promise<string | Buffer | "OK" | null>;
85
+ static CreateConnection(connectionAddress: string): AsyncClient
86
+ get(key: string): Promise<string | Buffer | null>
87
+ set(key: string, value: string): Promise<string | Buffer | "OK" | null>
113
88
  }
114
- /** A wrapper for a script object. As long as this object is alive, the script's code is saved in memory, and can be resent to the server. */
89
+ /**
90
+ * A wrapper for a script object. As long as this object is alive, the script's code is saved in memory, and can be resent to the server.
91
+ *
92
+ * **IMPORTANT**: Script objects are NOT automatically garbage collected. You are responsible for calling `release()`
93
+ * on every Script object when you're done with it to prevent memory leaks. Failure to do so will result in memory leaks.
94
+ */
115
95
  export declare class Script {
116
- /** Construct with the script's code. */
117
- constructor(code: string | Uint8Array);
118
- /** Returns the hash of the script. */
119
- getHash(): string;
120
- /**
121
- * Decrements the script's reference count in the local container.
122
- * Removes the script when the count reaches zero.
123
- *
124
- * This method is primarily intended for testing or manual cleanup.
125
- * It does not need to be called explicitly, as the script will be automatically
126
- * released when dropped.
127
- */
128
- release(): void;
96
+ /** Construct with the script's code. */
97
+ constructor(code: string | Uint8Array)
98
+ /** Returns the hash of the script. */
99
+ getHash(): string
100
+ /**
101
+ * Decrements the script's reference count in the local container.
102
+ * Removes the script when the count reaches zero.
103
+ *
104
+ * You need to call this method when you're done with the Script object. Script objects are NOT
105
+ * automatically garbage collected, and failure to call release() will result in memory leaks.
106
+ */
107
+ release(): void
129
108
  }
130
109
  /**
131
110
  * This struct is used to keep track of the cursor of a cluster scan.
@@ -150,9 +129,9 @@ export declare class Script {
150
129
  * ```
151
130
  */
152
131
  export declare class ClusterScanCursor {
153
- constructor(newCursor?: string | undefined | null);
154
- /** Returns the cursor id. */
155
- getCursor(): string;
156
- /** Returns true if the scan is finished. */
157
- isFinished(): boolean;
132
+ constructor(newCursor?: string | undefined | null)
133
+ /** Returns the cursor id. */
134
+ getCursor(): string
135
+ /** Returns true if the scan is finished. */
136
+ isFinished(): boolean
158
137
  }