@zuplo/cli 6.71.22 → 6.71.23
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.
- package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts +5 -0
- package/node_modules/@posthog/core/dist/posthog-core-stateless.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/posthog-core-stateless.js +50 -10
- package/node_modules/@posthog/core/dist/posthog-core-stateless.mjs +47 -10
- package/node_modules/@posthog/core/dist/posthog-core.d.ts +2 -2
- package/node_modules/@posthog/core/dist/posthog-core.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/posthog-core.js +10 -6
- package/node_modules/@posthog/core/dist/posthog-core.mjs +11 -7
- package/node_modules/@posthog/core/dist/testing/PostHogCoreTestClient.d.ts +1 -0
- package/node_modules/@posthog/core/dist/testing/PostHogCoreTestClient.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/testing/PostHogCoreTestClient.js +3 -0
- package/node_modules/@posthog/core/dist/testing/PostHogCoreTestClient.mjs +3 -0
- package/node_modules/@posthog/core/dist/utils/promise-queue.d.ts +3 -0
- package/node_modules/@posthog/core/dist/utils/promise-queue.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/utils/promise-queue.js +15 -3
- package/node_modules/@posthog/core/dist/utils/promise-queue.mjs +15 -3
- package/node_modules/@posthog/core/package.json +1 -1
- package/node_modules/@posthog/core/src/posthog-core-stateless.ts +80 -14
- package/node_modules/@posthog/core/src/posthog-core.ts +18 -7
- package/node_modules/@posthog/core/src/testing/PostHogCoreTestClient.ts +4 -0
- package/node_modules/@posthog/core/src/utils/promise-queue.ts +17 -4
- package/node_modules/@posthog/types/dist/posthog.d.ts +12 -0
- package/node_modules/@posthog/types/dist/posthog.d.ts.map +1 -1
- package/node_modules/@posthog/types/package.json +1 -1
- package/node_modules/@posthog/types/src/posthog.ts +13 -0
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/buffer.d.ts +64 -25
- package/node_modules/@types/node/crypto.d.ts +18 -5
- package/node_modules/@types/node/diagnostics_channel.d.ts +237 -3
- package/node_modules/@types/node/dns.d.ts +1 -1
- package/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@types/node/fs/promises.d.ts +3 -0
- package/node_modules/@types/node/fs.d.ts +21 -6
- package/node_modules/@types/node/http.d.ts +25 -0
- package/node_modules/@types/node/index.d.ts +1 -0
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/process.d.ts +14 -1
- package/node_modules/@types/node/quic.d.ts +92 -11
- package/node_modules/@types/node/sqlite.d.ts +55 -0
- package/node_modules/@types/node/stream/iter.d.ts +150 -0
- package/node_modules/@types/node/stream.d.ts +32 -0
- package/node_modules/@types/node/test.d.ts +112 -2
- package/node_modules/@types/node/ts5.6/index.d.ts +1 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +1 -0
- package/node_modules/@types/node/util.d.ts +19 -2
- package/node_modules/@types/node/v8.d.ts +84 -2
- package/node_modules/@types/node/worker_threads.d.ts +8 -7
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/out/esm/index.js +11 -11
- package/node_modules/@zuplo/graphql/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-54PA7VDV.js → chunk-4QJJMELB.js} +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-54PA7VDV.js.map → chunk-4QJJMELB.js.map} +1 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-5CYWMN74.js +402 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-5CYWMN74.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +7 -7
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +109 -19
- package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +33 -7
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/iconv-lite/encodings/sbcs-data.js +2 -0
- package/node_modules/iconv-lite/encodings/utf32.js +10 -3
- package/node_modules/iconv-lite/package.json +2 -2
- package/node_modules/iconv-lite/types/encodings.d.ts +2 -0
- package/node_modules/protobufjs/dist/light/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/light/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
- package/node_modules/protobufjs/dist/protobuf.js +5 -2
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/package.json +1 -1
- package/node_modules/protobufjs/src/parse.js +3 -0
- package/node_modules/toad-cache/README.md +10 -9
- package/node_modules/toad-cache/dist/toad-cache.cjs +139 -139
- package/node_modules/toad-cache/dist/toad-cache.mjs +136 -140
- package/node_modules/toad-cache/package.json +8 -8
- package/node_modules/toad-cache/toad-cache.d.cts +20 -14
- package/node_modules/toad-cache/toad-cache.d.ts +18 -14
- package/package.json +6 -6
- package/node_modules/@zuplo/runtime/out/esm/chunk-36XLJ4X6.js +0 -389
- package/node_modules/@zuplo/runtime/out/esm/chunk-36XLJ4X6.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-36XLJ4X6.js.LEGAL.txt → chunk-5CYWMN74.js.LEGAL.txt} +0 -0
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
declare module "node:ffi" {
|
|
2
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
3
|
+
interface FunctionSignature {
|
|
4
|
+
return?: ReturnType | undefined;
|
|
5
|
+
arguments?: readonly ArgumentType[] | undefined;
|
|
6
|
+
}
|
|
7
|
+
interface FunctionDefinitions {
|
|
8
|
+
[symbol: string]: FunctionSignature;
|
|
9
|
+
}
|
|
10
|
+
type CallbackFunction<R extends ReturnType = any, P extends readonly ArgumentType[] = any[]> = (
|
|
11
|
+
...args: { [K in keyof P]: ArgumentTypeMap[DataTypeMap[P[K]]] }
|
|
12
|
+
) => ReturnTypeMap[DataTypeMap[R]];
|
|
13
|
+
interface WrappedFunction<R extends ReturnType = any, P extends readonly ArgumentType[] = any[]>
|
|
14
|
+
extends CallbackFunction<R, P>
|
|
15
|
+
{
|
|
16
|
+
readonly pointer: bigint;
|
|
17
|
+
}
|
|
18
|
+
type CallbackFunctionFromSignature<T extends FunctionSignature> = CallbackFunction<
|
|
19
|
+
ReturnTypeFromFunctionSignature<T>,
|
|
20
|
+
ArgumentTypesFromFunctionSignature<T>
|
|
21
|
+
>;
|
|
22
|
+
type WrappedFunctionFromSignature<T extends FunctionSignature> = WrappedFunction<
|
|
23
|
+
ReturnTypeFromFunctionSignature<T>,
|
|
24
|
+
ArgumentTypesFromFunctionSignature<T>
|
|
25
|
+
>;
|
|
26
|
+
type WrappedFunctionsFromDefinitions<T extends FunctionDefinitions> = {
|
|
27
|
+
[K in keyof T]: WrappedFunctionFromSignature<T[K]>;
|
|
28
|
+
};
|
|
29
|
+
type ReturnTypeFromFunctionSignature<T extends FunctionSignature> = "return" extends keyof T
|
|
30
|
+
? T extends { return: infer R extends ReturnType } ? R : any
|
|
31
|
+
: "void";
|
|
32
|
+
type ArgumentTypesFromFunctionSignature<T extends FunctionSignature> = "arguments" extends keyof T
|
|
33
|
+
? T extends { arguments: infer P extends readonly ArgumentType[] } ? P : any[]
|
|
34
|
+
: [];
|
|
35
|
+
interface DynamicLibraryResult<T extends FunctionDefinitions> extends Disposable {
|
|
36
|
+
lib: DynamicLibrary;
|
|
37
|
+
functions: WrappedFunctionsFromDefinitions<T>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The native shared library suffix for the current platform:
|
|
41
|
+
*
|
|
42
|
+
* * `'dylib'` on macOS
|
|
43
|
+
* * `'so'` on Unix-like platforms
|
|
44
|
+
* * `'dll'` on Windows
|
|
45
|
+
*
|
|
46
|
+
* This can be used to build portable library paths:
|
|
47
|
+
*
|
|
48
|
+
* ```js
|
|
49
|
+
* const { suffix } = require('node:ffi');
|
|
50
|
+
*
|
|
51
|
+
* const path = `libsqlite3.${suffix}`;
|
|
52
|
+
* ```
|
|
53
|
+
* @since v26.1.0
|
|
54
|
+
*/
|
|
55
|
+
const suffix: string;
|
|
56
|
+
/**
|
|
57
|
+
* Loads a dynamic library and resolves the requested function definitions.
|
|
58
|
+
*
|
|
59
|
+
* On Windows passing `null` is not supported.
|
|
60
|
+
*
|
|
61
|
+
* When `definitions` is omitted, `functions` is returned as an empty object until
|
|
62
|
+
* symbols are resolved explicitly.
|
|
63
|
+
*
|
|
64
|
+
* The returned object also implements the explicit resource management protocol,
|
|
65
|
+
* so it can be used with the `using` declaration. Disposing the returned
|
|
66
|
+
* object closes the library handle.
|
|
67
|
+
*
|
|
68
|
+
* ```js
|
|
69
|
+
* import { dlopen } from 'node:ffi';
|
|
70
|
+
*
|
|
71
|
+
* {
|
|
72
|
+
* using handle = dlopen('./mylib.so', {
|
|
73
|
+
* add_i32: { arguments: ['i32', 'i32'], return: 'i32' },
|
|
74
|
+
* });
|
|
75
|
+
* console.log(handle.functions.add_i32(20, 22));
|
|
76
|
+
* } // handle.lib.close() is invoked automatically here.
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* ```js
|
|
80
|
+
* import { dlopen } from 'node:ffi';
|
|
81
|
+
*
|
|
82
|
+
* const { lib, functions } = dlopen('./mylib.so', {
|
|
83
|
+
* add_i32: { arguments: ['i32', 'i32'], return: 'i32' },
|
|
84
|
+
* string_length: { arguments: ['pointer'], return: 'u64' },
|
|
85
|
+
* });
|
|
86
|
+
*
|
|
87
|
+
* console.log(functions.add_i32(20, 22));
|
|
88
|
+
* ```
|
|
89
|
+
* @since v26.1.0
|
|
90
|
+
* @param path Path to a dynamic library, or `null` to resolve symbols
|
|
91
|
+
* from the current process image.
|
|
92
|
+
* @param definitions Symbol definitions to resolve immediately.
|
|
93
|
+
*/
|
|
94
|
+
function dlopen<const T extends FunctionDefinitions = {}>(
|
|
95
|
+
path: string | null,
|
|
96
|
+
definitions?: T,
|
|
97
|
+
): DynamicLibraryResult<T>;
|
|
98
|
+
/**
|
|
99
|
+
* Closes a dynamic library.
|
|
100
|
+
*
|
|
101
|
+
* This is equivalent to calling `handle.close()`.
|
|
102
|
+
* @since v26.1.0
|
|
103
|
+
*/
|
|
104
|
+
function dlclose(handle: DynamicLibrary): void;
|
|
105
|
+
/**
|
|
106
|
+
* Resolves a symbol address from a loaded library.
|
|
107
|
+
*
|
|
108
|
+
* This is equivalent to calling `handle.getSymbol(symbol)`.
|
|
109
|
+
* @since v26.1.0
|
|
110
|
+
*/
|
|
111
|
+
function dlsym(handle: DynamicLibrary, symbol: string): bigint;
|
|
112
|
+
/**
|
|
113
|
+
* @since v26.1.0
|
|
114
|
+
*/
|
|
115
|
+
class DynamicLibrary {
|
|
116
|
+
/**
|
|
117
|
+
* Loads the dynamic library without resolving any functions eagerly.
|
|
118
|
+
*
|
|
119
|
+
* On Windows passing `null` is not supported.
|
|
120
|
+
*
|
|
121
|
+
* ```js
|
|
122
|
+
* const { DynamicLibrary } = require('node:ffi');
|
|
123
|
+
*
|
|
124
|
+
* const lib = new DynamicLibrary('./mylib.so');
|
|
125
|
+
* ```
|
|
126
|
+
* @param path Path to a dynamic library, or `null` to resolve symbols
|
|
127
|
+
* from the current process image.
|
|
128
|
+
*/
|
|
129
|
+
constructor(path: string | null);
|
|
130
|
+
/**
|
|
131
|
+
* The path used to load the library.
|
|
132
|
+
*/
|
|
133
|
+
readonly path: string;
|
|
134
|
+
/**
|
|
135
|
+
* An object containing previously resolved symbol addresses as `bigint` values.
|
|
136
|
+
*/
|
|
137
|
+
readonly symbols: { [symbol: string]: bigint };
|
|
138
|
+
/**
|
|
139
|
+
* Closes the library handle.
|
|
140
|
+
*
|
|
141
|
+
* `DynamicLibrary` implements the explicit resource management protocol, so a
|
|
142
|
+
* library instance can be managed with the `using` declaration. Leaving the
|
|
143
|
+
* enclosing scope invokes `library.close()` automatically.
|
|
144
|
+
*
|
|
145
|
+
* ```js
|
|
146
|
+
* import { DynamicLibrary } from 'node:ffi';
|
|
147
|
+
*
|
|
148
|
+
* {
|
|
149
|
+
* using lib = new DynamicLibrary('./mylib.so');
|
|
150
|
+
* // Use `lib` here; `lib.close()` is called when the block exits.
|
|
151
|
+
* }
|
|
152
|
+
* ```
|
|
153
|
+
*
|
|
154
|
+
* Calling `library.close()` (or disposing the library) more than once is a no-op.
|
|
155
|
+
*
|
|
156
|
+
* After a library has been closed:
|
|
157
|
+
*
|
|
158
|
+
* * Resolved function wrappers become invalid.
|
|
159
|
+
* * Further symbol and function resolution throws.
|
|
160
|
+
* * Registered callbacks are invalidated.
|
|
161
|
+
*
|
|
162
|
+
* Closing a library does not make previously exported callback pointers safe to
|
|
163
|
+
* reuse. Node.js does not track or revoke callback pointers that have already
|
|
164
|
+
* been handed to native code.
|
|
165
|
+
*
|
|
166
|
+
* If native code still holds a callback pointer after `library.close()` or after
|
|
167
|
+
* `library.unregisterCallback(pointer)`, invoking that pointer has undefined
|
|
168
|
+
* behavior, is not allowed, and is dangerous: it can crash the process, produce
|
|
169
|
+
* incorrect output, or corrupt memory. Native code must stop using callback
|
|
170
|
+
* addresses before the library is closed or before the callback is unregistered.
|
|
171
|
+
*
|
|
172
|
+
* Calling `library.close()` from one of the library's active callbacks is
|
|
173
|
+
* unsupported and dangerous. The callback must return before the library is
|
|
174
|
+
* closed.
|
|
175
|
+
*/
|
|
176
|
+
close(): void;
|
|
177
|
+
/**
|
|
178
|
+
* Calls `library.close()`. This allows `DynamicLibrary` instances to be used with
|
|
179
|
+
* the `using` declaration for automatic cleanup when the enclosing scope
|
|
180
|
+
* exits. It is a no-op on a library that has already been closed.
|
|
181
|
+
* @since v26.1.0
|
|
182
|
+
*/
|
|
183
|
+
[Symbol.dispose](): void;
|
|
184
|
+
/**
|
|
185
|
+
* Resolves a symbol and returns a callable JavaScript wrapper.
|
|
186
|
+
*
|
|
187
|
+
* The returned function has a `.pointer` property containing the native function
|
|
188
|
+
* address as a `bigint`.
|
|
189
|
+
*
|
|
190
|
+
* If the same symbol has already been resolved, requesting it again with a
|
|
191
|
+
* different signature throws.
|
|
192
|
+
*
|
|
193
|
+
* ```js
|
|
194
|
+
* const { DynamicLibrary } = require('node:ffi');
|
|
195
|
+
*
|
|
196
|
+
* const lib = new DynamicLibrary('./mylib.so');
|
|
197
|
+
* const add = lib.getFunction('add_i32', {
|
|
198
|
+
* arguments: ['i32', 'i32'],
|
|
199
|
+
* return: 'i32',
|
|
200
|
+
* });
|
|
201
|
+
*
|
|
202
|
+
* console.log(add(20, 22));
|
|
203
|
+
* console.log(add.pointer);
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
getFunction<const T extends FunctionSignature>(name: string, signature: T): WrappedFunctionFromSignature<T>;
|
|
207
|
+
/**
|
|
208
|
+
* When `definitions` is provided, resolves each named symbol and returns an
|
|
209
|
+
* object containing callable wrappers.
|
|
210
|
+
*
|
|
211
|
+
* When `definitions` is omitted, returns wrappers for all functions that have
|
|
212
|
+
* already been resolved on the library.
|
|
213
|
+
*/
|
|
214
|
+
getFunctions(): { [symbol: string]: WrappedFunction };
|
|
215
|
+
getFunctions<const T extends FunctionDefinitions>(definitions: T): WrappedFunctionsFromDefinitions<T>;
|
|
216
|
+
/**
|
|
217
|
+
* Resolves a symbol and returns its native address as a `bigint`.
|
|
218
|
+
*/
|
|
219
|
+
getSymbol(name: string): bigint;
|
|
220
|
+
/**
|
|
221
|
+
* Returns an object containing all previously resolved symbol addresses.
|
|
222
|
+
*/
|
|
223
|
+
getSymbols(): Record<string, bigint>;
|
|
224
|
+
/**
|
|
225
|
+
* Creates a native callback pointer backed by a JavaScript function.
|
|
226
|
+
*
|
|
227
|
+
* When `signature` is omitted, the callback uses a default `void ()` signature.
|
|
228
|
+
*
|
|
229
|
+
* The return value is the callback pointer address as a `bigint`. It can be
|
|
230
|
+
* passed to native functions expecting a callback pointer.
|
|
231
|
+
*
|
|
232
|
+
* ```js
|
|
233
|
+
* const { DynamicLibrary } = require('node:ffi');
|
|
234
|
+
*
|
|
235
|
+
* const lib = new DynamicLibrary('./mylib.so');
|
|
236
|
+
*
|
|
237
|
+
* const callback = lib.registerCallback(
|
|
238
|
+
* { arguments: ['i32'], return: 'i32' },
|
|
239
|
+
* (value) => value * 2,
|
|
240
|
+
* );
|
|
241
|
+
* ```
|
|
242
|
+
*
|
|
243
|
+
* Callbacks are subject to the following restrictions:
|
|
244
|
+
*
|
|
245
|
+
* * They must be invoked on the same system thread where they were created.
|
|
246
|
+
* * They must not throw exceptions.
|
|
247
|
+
* * They must not return promises.
|
|
248
|
+
* * They must return a value compatible with the declared return type.
|
|
249
|
+
* * They must not call `library.close()` on their owning library while running.
|
|
250
|
+
* * They must not unregister themselves while running.
|
|
251
|
+
*
|
|
252
|
+
* Closing the owning library or unregistering the currently executing callback
|
|
253
|
+
* from inside the callback is unsupported and dangerous. Doing so may crash the
|
|
254
|
+
* process, produce incorrect output, or corrupt memory.
|
|
255
|
+
*/
|
|
256
|
+
registerCallback(callback: () => void): bigint;
|
|
257
|
+
registerCallback<const T extends FunctionSignature>(
|
|
258
|
+
signature: T,
|
|
259
|
+
callback: CallbackFunctionFromSignature<T>,
|
|
260
|
+
): bigint;
|
|
261
|
+
/**
|
|
262
|
+
* Releases a callback previously created with `library.registerCallback()`.
|
|
263
|
+
*
|
|
264
|
+
* Calling `library.unregisterCallback(pointer)` for a callback that is currently
|
|
265
|
+
* executing is unsupported and dangerous. The callback must return before it is
|
|
266
|
+
* unregistered.
|
|
267
|
+
*
|
|
268
|
+
* After `library.unregisterCallback(pointer)` returns, invoking that callback
|
|
269
|
+
* pointer from native code has undefined behavior, is not allowed, and is
|
|
270
|
+
* dangerous: it can crash the process, produce incorrect output, or corrupt
|
|
271
|
+
* memory.
|
|
272
|
+
*/
|
|
273
|
+
unregisterCallback(pointer: bigint): void;
|
|
274
|
+
/**
|
|
275
|
+
* Keeps the callback strongly referenced by JavaScript.
|
|
276
|
+
*/
|
|
277
|
+
refCallback(pointer: bigint): void;
|
|
278
|
+
/**
|
|
279
|
+
* Allows the callback to become weakly referenced by JavaScript.
|
|
280
|
+
*
|
|
281
|
+
* If the callback function is later garbage collected, subsequent native
|
|
282
|
+
* invocations become a no-op. Non-void return values are zero-initialized before
|
|
283
|
+
* returning to native code.
|
|
284
|
+
*/
|
|
285
|
+
unrefCallback(pointer: bigint): void;
|
|
286
|
+
}
|
|
287
|
+
function getInt8(pointer: bigint, offset?: number): number;
|
|
288
|
+
function getUint8(pointer: bigint, offset?: number): number;
|
|
289
|
+
function getInt16(pointer: bigint, offset?: number): number;
|
|
290
|
+
function getUint16(pointer: bigint, offset?: number): number;
|
|
291
|
+
function getInt32(pointer: bigint, offset?: number): number;
|
|
292
|
+
function getUint32(pointer: bigint, offset?: number): number;
|
|
293
|
+
function getInt64(pointer: bigint, offset?: number): bigint;
|
|
294
|
+
function getUint64(pointer: bigint, offset?: number): bigint;
|
|
295
|
+
function getFloat32(pointer: bigint, offset?: number): number;
|
|
296
|
+
function getFloat64(pointer: bigint, offset?: number): number;
|
|
297
|
+
function setInt8(pointer: bigint, offset: number, value: number): void;
|
|
298
|
+
function setUint8(pointer: bigint, offset: number, value: number): void;
|
|
299
|
+
function setInt16(pointer: bigint, offset: number, value: number): void;
|
|
300
|
+
function setUint16(pointer: bigint, offset: number, value: number): void;
|
|
301
|
+
function setInt32(pointer: bigint, offset: number, value: number): void;
|
|
302
|
+
function setUint32(pointer: bigint, offset: number, value: number): void;
|
|
303
|
+
function setInt64(pointer: bigint, offset: number, value: number | bigint): void;
|
|
304
|
+
function setUint64(pointer: bigint, offset: number, value: number | bigint): void;
|
|
305
|
+
function setFloat32(pointer: bigint, offset: number, value: number): void;
|
|
306
|
+
function setFloat64(pointer: bigint, offset: number, value: number): void;
|
|
307
|
+
/**
|
|
308
|
+
* Reads a NUL-terminated UTF-8 string from native memory.
|
|
309
|
+
*
|
|
310
|
+
* If `pointer` is `0n`, `null` is returned.
|
|
311
|
+
*
|
|
312
|
+
* This function does not validate that `pointer` refers to readable memory or
|
|
313
|
+
* that the pointed-to data is terminated with `\0`. Passing an invalid pointer,
|
|
314
|
+
* a pointer to freed memory, or a pointer to bytes without a terminating NUL can
|
|
315
|
+
* read unrelated memory, crash the process, or produce truncated or garbled
|
|
316
|
+
* output.
|
|
317
|
+
* @since v26.1.0
|
|
318
|
+
*/
|
|
319
|
+
function toString(pointer: bigint): string | null;
|
|
320
|
+
/**
|
|
321
|
+
* Creates a `Buffer` from native memory.
|
|
322
|
+
*
|
|
323
|
+
* When `copy` is `true`, the returned `Buffer` owns its own copied memory.
|
|
324
|
+
* When `copy` is `false`, the returned `Buffer` references the original native
|
|
325
|
+
* memory directly.
|
|
326
|
+
*
|
|
327
|
+
* Using `copy: false` is a zero-copy escape hatch. The returned `Buffer` is a
|
|
328
|
+
* writable view onto foreign memory, so writes in JavaScript update the original
|
|
329
|
+
* native memory directly. The caller must guarantee that:
|
|
330
|
+
*
|
|
331
|
+
* * `pointer` remains valid for the entire lifetime of the returned `Buffer`.
|
|
332
|
+
* * `length` stays within the allocated native region.
|
|
333
|
+
* * no native code frees or repurposes that memory while JavaScript still uses
|
|
334
|
+
* the `Buffer`.
|
|
335
|
+
* * Memory protection is observed. For example, read-only memory pages must not
|
|
336
|
+
* be written to.
|
|
337
|
+
*
|
|
338
|
+
* If these guarantees are not met, reading or writing the `Buffer` can corrupt
|
|
339
|
+
* memory or crash the process.
|
|
340
|
+
* @since v26.1.0
|
|
341
|
+
* @param copy When `false`, creates a zero-copy view. **Default:** `true`.
|
|
342
|
+
*/
|
|
343
|
+
function toBuffer(pointer: bigint, length: number, copy?: boolean): NonSharedBuffer;
|
|
344
|
+
/**
|
|
345
|
+
* Creates an `ArrayBuffer` from native memory.
|
|
346
|
+
*
|
|
347
|
+
* When `copy` is `true`, the returned `ArrayBuffer` contains copied bytes.
|
|
348
|
+
* When `copy` is `false`, the returned `ArrayBuffer` references the original
|
|
349
|
+
* native memory directly.
|
|
350
|
+
*
|
|
351
|
+
* The same lifetime and bounds requirements described for
|
|
352
|
+
* `ffi.toBuffer(pointer, length, copy)` apply
|
|
353
|
+
* here. With `copy: false`, the
|
|
354
|
+
* returned `ArrayBuffer` is a zero-copy view of foreign memory and is only safe
|
|
355
|
+
* while that memory remains allocated, unchanged in layout, and valid for the
|
|
356
|
+
* entire exposed range.
|
|
357
|
+
* @since v26.1.0
|
|
358
|
+
* @param copy When `false`, creates a zero-copy view. **Default:** `true`.
|
|
359
|
+
*/
|
|
360
|
+
function toArrayBuffer(pointer: bigint, length: number, copy?: boolean): ArrayBuffer;
|
|
361
|
+
/**
|
|
362
|
+
* Copies a JavaScript string into native memory and appends a trailing NUL
|
|
363
|
+
* terminator.
|
|
364
|
+
*
|
|
365
|
+
* `length` must be large enough to hold the full encoded string plus the trailing
|
|
366
|
+
* NUL terminator. For UTF-16 and UCS-2 encodings, the trailing terminator uses
|
|
367
|
+
* two zero bytes.
|
|
368
|
+
*
|
|
369
|
+
* `pointer` must refer to writable native memory with at least `length` bytes of
|
|
370
|
+
* available storage. This function does not allocate memory on its own.
|
|
371
|
+
*
|
|
372
|
+
* `string` must be a JavaScript string. `encoding` must be a string.
|
|
373
|
+
* @since v26.1.0
|
|
374
|
+
* @param encoding **Default:** `'utf8'`.
|
|
375
|
+
*/
|
|
376
|
+
function exportString(string: string, pointer: bigint, length: number, encoding?: BufferEncoding): void;
|
|
377
|
+
/**
|
|
378
|
+
* Copies bytes from a `Buffer` into native memory.
|
|
379
|
+
*
|
|
380
|
+
* `length` must be at least `buffer.length`.
|
|
381
|
+
*
|
|
382
|
+
* `pointer` must refer to writable native memory with at least `length` bytes of
|
|
383
|
+
* available storage. This function does not allocate memory on its own.
|
|
384
|
+
*
|
|
385
|
+
* `buffer` must be a Node.js `Buffer`.
|
|
386
|
+
* @since v26.1.0
|
|
387
|
+
*/
|
|
388
|
+
function exportBuffer(buffer: Buffer, pointer: bigint, length: number): void;
|
|
389
|
+
/**
|
|
390
|
+
* Copies bytes from an `ArrayBuffer` into native memory.
|
|
391
|
+
*
|
|
392
|
+
* `length` must be at least `arrayBuffer.byteLength`.
|
|
393
|
+
*
|
|
394
|
+
* `pointer` must refer to writable native memory with at least `length` bytes of
|
|
395
|
+
* available storage. This function does not allocate memory on its own.
|
|
396
|
+
* @since v26.1.0
|
|
397
|
+
*/
|
|
398
|
+
function exportArrayBuffer(arrayBuffer: ArrayBuffer, pointer: bigint, length: number): void;
|
|
399
|
+
/**
|
|
400
|
+
* Copies bytes from an `ArrayBufferView` into native memory.
|
|
401
|
+
*
|
|
402
|
+
* `length` must be at least `arrayBufferView.byteLength`.
|
|
403
|
+
*
|
|
404
|
+
* `pointer` must refer to writable native memory with at least `length` bytes of
|
|
405
|
+
* available storage. This function does not allocate memory on its own.
|
|
406
|
+
* @since v26.1.0
|
|
407
|
+
*/
|
|
408
|
+
function exportArrayBufferView(arrayBufferView: NodeJS.ArrayBufferView, pointer: bigint, length: number): void;
|
|
409
|
+
/**
|
|
410
|
+
* Returns the raw memory address of JavaScript-managed byte storage.
|
|
411
|
+
*
|
|
412
|
+
* This is unsafe and dangerous. The returned pointer can become invalid if the
|
|
413
|
+
* underlying memory is detached, resized, transferred, or otherwise invalidated.
|
|
414
|
+
* Using stale pointers can cause memory corruption or process crashes.
|
|
415
|
+
* @since v26.1.0
|
|
416
|
+
*/
|
|
417
|
+
function getRawPointer(source: ArrayBuffer | NodeJS.ArrayBufferView): bigint;
|
|
418
|
+
type ReturnType = { [K in keyof DataTypeMap]: K }[keyof DataTypeMap];
|
|
419
|
+
type ArgumentType = Exclude<ReturnType, "void">;
|
|
420
|
+
interface DataTypeMap {
|
|
421
|
+
void: "void";
|
|
422
|
+
char: "number";
|
|
423
|
+
bool: "number";
|
|
424
|
+
i8: "number";
|
|
425
|
+
int8: "number";
|
|
426
|
+
u8: "number";
|
|
427
|
+
uint8: "number";
|
|
428
|
+
i16: "number";
|
|
429
|
+
int16: "number";
|
|
430
|
+
u16: "number";
|
|
431
|
+
uint16: "number";
|
|
432
|
+
i32: "number";
|
|
433
|
+
int32: "number";
|
|
434
|
+
u32: "number";
|
|
435
|
+
uint32: "number";
|
|
436
|
+
i64: "bigint";
|
|
437
|
+
int64: "bigint";
|
|
438
|
+
u64: "bigint";
|
|
439
|
+
uint64: "bigint";
|
|
440
|
+
float: "number";
|
|
441
|
+
f32: "number";
|
|
442
|
+
double: "number";
|
|
443
|
+
f64: "number";
|
|
444
|
+
pointer: "pointer";
|
|
445
|
+
ptr: "pointer";
|
|
446
|
+
function: "pointer";
|
|
447
|
+
buffer: "pointer";
|
|
448
|
+
arraybuffer: "pointer";
|
|
449
|
+
string: "pointer";
|
|
450
|
+
str: "pointer";
|
|
451
|
+
}
|
|
452
|
+
interface ArgumentTypeMap {
|
|
453
|
+
"number": number;
|
|
454
|
+
"bigint": bigint;
|
|
455
|
+
"pointer": bigint | string | ArrayBuffer | NodeJS.ArrayBufferView | null;
|
|
456
|
+
}
|
|
457
|
+
interface ReturnTypeMap {
|
|
458
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
459
|
+
"void": void;
|
|
460
|
+
"number": number;
|
|
461
|
+
"bigint": bigint;
|
|
462
|
+
"pointer": bigint | null;
|
|
463
|
+
}
|
|
464
|
+
enum types {
|
|
465
|
+
VOID = "void",
|
|
466
|
+
POINTER = "pointer",
|
|
467
|
+
BUFFER = "buffer",
|
|
468
|
+
ARRAY_BUFFER = "arraybuffer",
|
|
469
|
+
FUNCTION = "function",
|
|
470
|
+
BOOL = "bool",
|
|
471
|
+
CHAR = "char",
|
|
472
|
+
STRING = "string",
|
|
473
|
+
FLOAT = "float",
|
|
474
|
+
DOUBLE = "double",
|
|
475
|
+
INT_8 = "int8",
|
|
476
|
+
UINT_8 = "uint8",
|
|
477
|
+
INT_16 = "int16",
|
|
478
|
+
UINT_16 = "uint16",
|
|
479
|
+
INT_32 = "int32",
|
|
480
|
+
UINT_32 = "uint32",
|
|
481
|
+
INT_64 = "int64",
|
|
482
|
+
UINT_64 = "uint64",
|
|
483
|
+
FLOAT_32 = "float32",
|
|
484
|
+
FLOAT_64 = "float64",
|
|
485
|
+
}
|
|
486
|
+
}
|
|
@@ -1439,6 +1439,9 @@ declare module "node:fs/promises" {
|
|
|
1439
1439
|
*/
|
|
1440
1440
|
function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise<void>;
|
|
1441
1441
|
/**
|
|
1442
|
+
* When `followSymlinks` is enabled, detected symbolic link cycles are not
|
|
1443
|
+
* traversed recursively.
|
|
1444
|
+
*
|
|
1442
1445
|
* ```js
|
|
1443
1446
|
* import { glob } from 'node:fs/promises';
|
|
1444
1447
|
*
|
|
@@ -126,6 +126,8 @@ declare module "node:fs" {
|
|
|
126
126
|
bavail: T;
|
|
127
127
|
/** Total file nodes in file system. */
|
|
128
128
|
files: T;
|
|
129
|
+
/** Fundamental file system block size. */
|
|
130
|
+
frsize: T;
|
|
129
131
|
/** Free file nodes in file system. */
|
|
130
132
|
ffree: T;
|
|
131
133
|
}
|
|
@@ -4576,6 +4578,7 @@ declare module "node:fs" {
|
|
|
4576
4578
|
bigint: true;
|
|
4577
4579
|
}
|
|
4578
4580
|
interface StatOptions {
|
|
4581
|
+
// TODO: add signal option once we sort its behavior out upstream
|
|
4579
4582
|
bigint?: boolean | undefined;
|
|
4580
4583
|
throwIfNoEntry?: boolean | undefined;
|
|
4581
4584
|
}
|
|
@@ -4675,12 +4678,6 @@ declare module "node:fs" {
|
|
|
4675
4678
|
* @default process.cwd()
|
|
4676
4679
|
*/
|
|
4677
4680
|
cwd?: string | URL | undefined;
|
|
4678
|
-
/**
|
|
4679
|
-
* `true` if the glob should return paths as `Dirent`s, `false` otherwise.
|
|
4680
|
-
* @default false
|
|
4681
|
-
* @since v22.2.0
|
|
4682
|
-
*/
|
|
4683
|
-
withFileTypes?: boolean | undefined;
|
|
4684
4681
|
/**
|
|
4685
4682
|
* Function to filter out files/directories or a
|
|
4686
4683
|
* list of glob patterns to be excluded. If a function is provided, return
|
|
@@ -4691,6 +4688,18 @@ declare module "node:fs" {
|
|
|
4691
4688
|
* @default undefined
|
|
4692
4689
|
*/
|
|
4693
4690
|
exclude?: ((fileName: T) => boolean) | readonly string[] | undefined;
|
|
4691
|
+
/**
|
|
4692
|
+
* When `true`, symbolic links to directories are
|
|
4693
|
+
* followed while expanding `**` patterns.
|
|
4694
|
+
* @default false
|
|
4695
|
+
*/
|
|
4696
|
+
followSymlinks?: boolean | undefined;
|
|
4697
|
+
/**
|
|
4698
|
+
* `true` if the glob should return paths as `Dirent`s, `false` otherwise.
|
|
4699
|
+
* @default false
|
|
4700
|
+
* @since v22.2.0
|
|
4701
|
+
*/
|
|
4702
|
+
withFileTypes?: boolean | undefined;
|
|
4694
4703
|
}
|
|
4695
4704
|
interface GlobOptionsWithFileTypes extends GlobOptions<Dirent> {
|
|
4696
4705
|
withFileTypes: true;
|
|
@@ -4702,6 +4711,9 @@ declare module "node:fs" {
|
|
|
4702
4711
|
/**
|
|
4703
4712
|
* Retrieves the files matching the specified pattern.
|
|
4704
4713
|
*
|
|
4714
|
+
* When `followSymlinks` is enabled, detected symbolic link cycles are not
|
|
4715
|
+
* traversed recursively.
|
|
4716
|
+
*
|
|
4705
4717
|
* ```js
|
|
4706
4718
|
* import { glob } from 'node:fs';
|
|
4707
4719
|
*
|
|
@@ -4741,6 +4753,9 @@ declare module "node:fs" {
|
|
|
4741
4753
|
) => void,
|
|
4742
4754
|
): void;
|
|
4743
4755
|
/**
|
|
4756
|
+
* When `followSymlinks` is enabled, detected symbolic link cycles are not
|
|
4757
|
+
* traversed recursively.
|
|
4758
|
+
*
|
|
4744
4759
|
* ```js
|
|
4745
4760
|
* import { globSync } from 'node:fs';
|
|
4746
4761
|
*
|
|
@@ -1325,6 +1325,31 @@ declare module "node:http" {
|
|
|
1325
1325
|
* @since v0.5.9
|
|
1326
1326
|
*/
|
|
1327
1327
|
setTimeout(msecs: number, callback?: () => void): this;
|
|
1328
|
+
/**
|
|
1329
|
+
* An `AbortSignal` that is aborted when the underlying socket closes or the
|
|
1330
|
+
* request is destroyed. The signal is created lazily on first access — no
|
|
1331
|
+
* `AbortController` is allocated for requests that never use this property.
|
|
1332
|
+
*
|
|
1333
|
+
* This is useful for cancelling downstream asynchronous work such as database
|
|
1334
|
+
* queries or `fetch` calls when a client disconnects mid-request.
|
|
1335
|
+
*
|
|
1336
|
+
* ```js
|
|
1337
|
+
* import http from 'node:http';
|
|
1338
|
+
*
|
|
1339
|
+
* http.createServer(async (req, res) => {
|
|
1340
|
+
* try {
|
|
1341
|
+
* const data = await fetch('https://example.com/api', { signal: req.signal });
|
|
1342
|
+
* res.end(JSON.stringify(await data.json()));
|
|
1343
|
+
* } catch (err) {
|
|
1344
|
+
* if (err.name === 'AbortError') return;
|
|
1345
|
+
* res.statusCode = 500;
|
|
1346
|
+
* res.end('Internal Server Error');
|
|
1347
|
+
* }
|
|
1348
|
+
* }).listen(3000);
|
|
1349
|
+
* ```
|
|
1350
|
+
* @since v26.1.0
|
|
1351
|
+
*/
|
|
1352
|
+
readonly signal: AbortSignal;
|
|
1328
1353
|
/**
|
|
1329
1354
|
* **Only valid for request obtained from {@link Server}.**
|
|
1330
1355
|
*
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
/// <reference path="dns/promises.d.ts" />
|
|
67
67
|
/// <reference path="domain.d.ts" />
|
|
68
68
|
/// <reference path="events.d.ts" />
|
|
69
|
+
/// <reference path="ffi.d.ts" />
|
|
69
70
|
/// <reference path="fs.d.ts" />
|
|
70
71
|
/// <reference path="fs/promises.d.ts" />
|
|
71
72
|
/// <reference path="http.d.ts" />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "26.0
|
|
3
|
+
"version": "26.1.0",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -150,6 +150,6 @@
|
|
|
150
150
|
"undici-types": "~8.3.0"
|
|
151
151
|
},
|
|
152
152
|
"peerDependencies": {},
|
|
153
|
-
"typesPublisherContentHash": "
|
|
153
|
+
"typesPublisherContentHash": "bac6fe2369bbd2e0f2cf6643373e8c398ed66b886a72749c8d1fb0b9b60031ab",
|
|
154
154
|
"typeScriptVersion": "5.6"
|
|
155
155
|
}
|
|
@@ -34,6 +34,7 @@ declare module "node:process" {
|
|
|
34
34
|
"node:domain": typeof import("node:domain");
|
|
35
35
|
"events": typeof import("events");
|
|
36
36
|
"node:events": typeof import("node:events");
|
|
37
|
+
"node:ffi": typeof import("node:ffi");
|
|
37
38
|
"fs": typeof import("fs");
|
|
38
39
|
"node:fs": typeof import("node:fs");
|
|
39
40
|
"fs/promises": typeof import("fs/promises");
|
|
@@ -2130,7 +2131,19 @@ declare module "node:process" {
|
|
|
2130
2131
|
* All other resources are discarded by the system when the processes are swapped, without triggering
|
|
2131
2132
|
* any exit or close events and without running any cleanup handler.
|
|
2132
2133
|
*
|
|
2133
|
-
*
|
|
2134
|
+
* On success, all other resources are discarded by the system when the
|
|
2135
|
+
* processes are swapped, without triggering any exit or close events, without
|
|
2136
|
+
* running any JavaScript cleanup handler (for example `process.on('exit')`),
|
|
2137
|
+
* and without invoking native `AtExit` callbacks registered through the
|
|
2138
|
+
* embedder API. Callers that need to run cleanup logic should do so before
|
|
2139
|
+
* calling `process.execve()`.
|
|
2140
|
+
*
|
|
2141
|
+
* This function does not return on success. If the underlying `execve(2)`
|
|
2142
|
+
* system call fails, an `Error` is thrown whose `code` property is set to the
|
|
2143
|
+
* corresponding `errno` string (for example, `'ENOENT'` when `file` does not
|
|
2144
|
+
* exist), with `syscall` set to `'execve'` and `path` set to `file`. When
|
|
2145
|
+
* `execve(2)` fails the current process continues to run with its state
|
|
2146
|
+
* unchanged, so a caller may handle the error and take another action.
|
|
2134
2147
|
*
|
|
2135
2148
|
* This function is not available on Windows or IBM i.
|
|
2136
2149
|
* @since v22.15.0
|