bun-types 1.2.6 → 1.2.7
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/README.md +1 -3
- package/bun.d.ts +7186 -7604
- package/bun.ns.d.ts +7 -0
- package/deprecated.d.ts +53 -58
- package/devserver.d.ts +177 -183
- package/docs/api/cookie.md +449 -0
- package/docs/api/fetch.md +1 -1
- package/docs/api/http.md +78 -0
- package/docs/api/spawn.md +1 -1
- package/docs/cli/publish.md +1 -1
- package/docs/guides/ecosystem/nuxt.md +1 -1
- package/docs/guides/install/add-peer.md +2 -2
- package/docs/guides/install/from-npm-install-to-bun-install.md +1 -1
- package/docs/guides/runtime/typescript.md +7 -6
- package/docs/guides/test/run-tests.md +3 -3
- package/docs/guides/test/snapshot.md +3 -3
- package/docs/guides/test/update-snapshots.md +1 -1
- package/docs/guides/util/version.md +1 -1
- package/docs/installation.md +4 -4
- package/docs/runtime/debugger.md +3 -3
- package/docs/runtime/nodejs-apis.md +1 -1
- package/docs/test/dom.md +1 -1
- package/docs/typescript.md +7 -6
- package/extensions.d.ts +31 -0
- package/fetch.d.ts +62 -159
- package/ffi.d.ts +1084 -1108
- package/globals.d.ts +1721 -1949
- package/html-rewriter.d.ts +146 -151
- package/index.d.ts +13 -11
- package/jsc.d.ts +216 -230
- package/overrides.d.ts +106 -63
- package/package.json +39 -31
- package/s3.d.ts +825 -0
- package/sqlite.d.ts +1143 -1172
- package/test.d.ts +2130 -2241
- package/wasm.d.ts +190 -288
- package/ambient.d.ts +0 -31
package/jsc.d.ts
CHANGED
|
@@ -1,243 +1,229 @@
|
|
|
1
1
|
declare module "bun:jsc" {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
function reoptimizationRetryCount(func: (...args: any[]) => any): number;
|
|
42
|
-
function drainMicrotasks(): void;
|
|
2
|
+
/**
|
|
3
|
+
* This used to be called "describe" but it could be confused with the test runner.
|
|
4
|
+
*/
|
|
5
|
+
function jscDescribe(value: any): string;
|
|
6
|
+
function jscDescribeArray(args: any[]): string;
|
|
7
|
+
function gcAndSweep(): number;
|
|
8
|
+
function fullGC(): number;
|
|
9
|
+
function edenGC(): number;
|
|
10
|
+
function heapSize(): number;
|
|
11
|
+
function heapStats(): {
|
|
12
|
+
heapSize: number;
|
|
13
|
+
heapCapacity: number;
|
|
14
|
+
extraMemorySize: number;
|
|
15
|
+
objectCount: number;
|
|
16
|
+
protectedObjectCount: number;
|
|
17
|
+
globalObjectCount: number;
|
|
18
|
+
protectedGlobalObjectCount: number;
|
|
19
|
+
objectTypeCounts: Record<string, number>;
|
|
20
|
+
protectedObjectTypeCounts: Record<string, number>;
|
|
21
|
+
};
|
|
22
|
+
function memoryUsage(): {
|
|
23
|
+
current: number;
|
|
24
|
+
peak: number;
|
|
25
|
+
currentCommit: number;
|
|
26
|
+
peakCommit: number;
|
|
27
|
+
pageFaults: number;
|
|
28
|
+
};
|
|
29
|
+
function getRandomSeed(): number;
|
|
30
|
+
function setRandomSeed(value: number): void;
|
|
31
|
+
function isRope(input: string): boolean;
|
|
32
|
+
function callerSourceOrigin(): string;
|
|
33
|
+
function noFTL(func: (...args: any[]) => any): (...args: any[]) => any;
|
|
34
|
+
function noOSRExitFuzzing(func: (...args: any[]) => any): (...args: any[]) => any;
|
|
35
|
+
function optimizeNextInvocation(func: (...args: any[]) => any): void;
|
|
36
|
+
function numberOfDFGCompiles(func: (...args: any[]) => any): number;
|
|
37
|
+
function releaseWeakRefs(): void;
|
|
38
|
+
function totalCompileTime(func: (...args: any[]) => any): number;
|
|
39
|
+
function reoptimizationRetryCount(func: (...args: any[]) => any): number;
|
|
40
|
+
function drainMicrotasks(): void;
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
value: any,
|
|
54
|
-
options?: { binaryType?: "arraybuffer" },
|
|
55
|
-
): SharedArrayBuffer;
|
|
42
|
+
/**
|
|
43
|
+
* Convert a JavaScript value to a binary representation that can be sent to another Bun instance.
|
|
44
|
+
*
|
|
45
|
+
* Internally, this uses the serialization format from WebKit/Safari.
|
|
46
|
+
*
|
|
47
|
+
* @param value A JavaScript value, usually an object or array, to be converted.
|
|
48
|
+
* @returns A SharedArrayBuffer that can be sent to another Bun instance.
|
|
49
|
+
*/
|
|
50
|
+
function serialize(value: any, options?: { binaryType?: "arraybuffer" }): SharedArrayBuffer;
|
|
56
51
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
value: any,
|
|
67
|
-
options?: { binaryType: "nodebuffer" },
|
|
68
|
-
): Buffer;
|
|
52
|
+
/**
|
|
53
|
+
* Convert a JavaScript value to a binary representation that can be sent to another Bun instance.
|
|
54
|
+
*
|
|
55
|
+
* Internally, this uses the serialization format from WebKit/Safari.
|
|
56
|
+
*
|
|
57
|
+
* @param value A JavaScript value, usually an object or array, to be converted.
|
|
58
|
+
* @returns A Buffer that can be sent to another Bun instance.
|
|
59
|
+
*/
|
|
60
|
+
function serialize(value: any, options?: { binaryType: "nodebuffer" }): Buffer;
|
|
69
61
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
value: ArrayBufferLike | NodeJS.TypedArray | Buffer,
|
|
77
|
-
): any;
|
|
62
|
+
/**
|
|
63
|
+
* Convert an ArrayBuffer or Buffer to a JavaScript value compatible with the HTML Structured Clone Algorithm.
|
|
64
|
+
*
|
|
65
|
+
* @param value A serialized value, usually an ArrayBuffer or Buffer, to be converted.
|
|
66
|
+
*/
|
|
67
|
+
function deserialize(value: ArrayBufferLike | NodeJS.TypedArray | Buffer): any;
|
|
78
68
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Set the timezone used by Intl, Date, etc.
|
|
71
|
+
*
|
|
72
|
+
* @param timeZone A string representing the time zone to use, such as "America/Los_Angeles"
|
|
73
|
+
*
|
|
74
|
+
* @returns The normalized time zone string
|
|
75
|
+
*
|
|
76
|
+
* You can also set process.env.TZ to the time zone you want to use.
|
|
77
|
+
* You can also view the current timezone with `Intl.DateTimeFormat().resolvedOptions().timeZone`
|
|
78
|
+
*/
|
|
79
|
+
function setTimeZone(timeZone: string): string;
|
|
90
80
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
81
|
+
interface SamplingProfile {
|
|
82
|
+
/**
|
|
83
|
+
* A formatted summary of the top functions
|
|
84
|
+
*
|
|
85
|
+
* Example output:
|
|
86
|
+
* ```js
|
|
87
|
+
*
|
|
88
|
+
* Sampling rate: 100.000000 microseconds. Total samples: 6858
|
|
89
|
+
* Top functions as <numSamples 'functionName#hash:sourceID'>
|
|
90
|
+
* 2948 '#<nil>:8'
|
|
91
|
+
* 393 'visit#<nil>:8'
|
|
92
|
+
* 263 'push#<nil>:8'
|
|
93
|
+
* 164 'scan_ref_scoped#<nil>:8'
|
|
94
|
+
* 164 'walk#<nil>:8'
|
|
95
|
+
* 144 'pop#<nil>:8'
|
|
96
|
+
* 107 'extract_candidates#<nil>:8'
|
|
97
|
+
* 94 'get#<nil>:8'
|
|
98
|
+
* 82 'Function#<nil>:4294967295'
|
|
99
|
+
* 79 'set#<nil>:8'
|
|
100
|
+
* 67 'forEach#<nil>:5'
|
|
101
|
+
* 58 'collapse#<nil>:8'
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
functions: string;
|
|
105
|
+
/**
|
|
106
|
+
* A formatted summary of the top bytecodes
|
|
107
|
+
*
|
|
108
|
+
* Example output:
|
|
109
|
+
* ```js
|
|
110
|
+
* Tier breakdown:
|
|
111
|
+
* -----------------------------------
|
|
112
|
+
* LLInt: 106 (1.545640%)
|
|
113
|
+
* Baseline: 2355 (34.339458%)
|
|
114
|
+
* DFG: 3290 (47.973170%)
|
|
115
|
+
* FTL: 833 (12.146398%)
|
|
116
|
+
* js builtin: 132 (1.924759%)
|
|
117
|
+
* Wasm: 0 (0.000000%)
|
|
118
|
+
* Host: 111 (1.618548%)
|
|
119
|
+
* RegExp: 15 (0.218723%)
|
|
120
|
+
* C/C++: 0 (0.000000%)
|
|
121
|
+
* Unknown Executable: 148 (2.158064%)
|
|
122
|
+
*
|
|
123
|
+
* Hottest bytecodes as <numSamples 'functionName#hash:JITType:bytecodeIndex'>
|
|
124
|
+
* 273 'visit#<nil>:DFG:bc#63'
|
|
125
|
+
* 121 'walk#<nil>:DFG:bc#7'
|
|
126
|
+
* 119 '#<nil>:Baseline:bc#1'
|
|
127
|
+
* 82 'Function#<nil>:None:<nil>'
|
|
128
|
+
* 66 '#<nil>:DFG:bc#11'
|
|
129
|
+
* 65 '#<nil>:DFG:bc#33'
|
|
130
|
+
* 58 '#<nil>:Baseline:bc#7'
|
|
131
|
+
* 53 '#<nil>:Baseline:bc#23'
|
|
132
|
+
* 50 'forEach#<nil>:DFG:bc#83'
|
|
133
|
+
* 49 'pop#<nil>:FTL:bc#65'
|
|
134
|
+
* 47 '#<nil>:DFG:bc#99'
|
|
135
|
+
* 45 '#<nil>:DFG:bc#16'
|
|
136
|
+
* 44 '#<nil>:DFG:bc#7'
|
|
137
|
+
* 44 '#<nil>:Baseline:bc#30'
|
|
138
|
+
* 44 'push#<nil>:FTL:bc#214'
|
|
139
|
+
* 41 '#<nil>:DFG:bc#50'
|
|
140
|
+
* 39 'get#<nil>:DFG:bc#27'
|
|
141
|
+
* 39 '#<nil>:Baseline:bc#0'
|
|
142
|
+
* 36 '#<nil>:DFG:bc#27'
|
|
143
|
+
* 36 'Dictionary#<nil>:DFG:bc#41'
|
|
144
|
+
* 36 'visit#<nil>:DFG:bc#81'
|
|
145
|
+
* 36 'get#<nil>:FTL:bc#11'
|
|
146
|
+
* 32 'push#<nil>:FTL:bc#49'
|
|
147
|
+
* 31 '#<nil>:DFG:bc#76'
|
|
148
|
+
* 31 '#<nil>:DFG:bc#10'
|
|
149
|
+
* 31 '#<nil>:DFG:bc#73'
|
|
150
|
+
* 29 'set#<nil>:DFG:bc#28'
|
|
151
|
+
* 28 'in_boolean_context#<nil>:DFG:bc#104'
|
|
152
|
+
* 28 '#<nil>:Baseline:<nil>'
|
|
153
|
+
* 28 'regExpSplitFast#<nil>:None:<nil>'
|
|
154
|
+
* 26 'visit#<nil>:DFG:bc#95'
|
|
155
|
+
* 26 'pop#<nil>:FTL:bc#120'
|
|
156
|
+
* 25 '#<nil>:DFG:bc#23'
|
|
157
|
+
* 25 'push#<nil>:FTL:bc#152'
|
|
158
|
+
* 24 'push#<nil>:FTL:bc#262'
|
|
159
|
+
* 24 '#<nil>:FTL:bc#10'
|
|
160
|
+
* 23 'is_identifier_char#<nil>:DFG:bc#22'
|
|
161
|
+
* 23 'visit#<nil>:DFG:bc#22'
|
|
162
|
+
* 22 '#<nil>:FTL:bc#27'
|
|
163
|
+
* 22 'indexOf#<nil>:None:<nil>'
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
bytecodes: string;
|
|
177
167
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
168
|
+
/**
|
|
169
|
+
* Stack traces of the top functions
|
|
170
|
+
*/
|
|
171
|
+
stackTraces: string[];
|
|
172
|
+
}
|
|
183
173
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
? Promise<SamplingProfile>
|
|
201
|
-
: SamplingProfile;
|
|
174
|
+
/**
|
|
175
|
+
* Run JavaScriptCore's sampling profiler for a particular function
|
|
176
|
+
*
|
|
177
|
+
* This is pretty low-level.
|
|
178
|
+
*
|
|
179
|
+
* Things to know:
|
|
180
|
+
* - LLint means "Low Level Interpreter", which is the interpreter that runs before any JIT compilation
|
|
181
|
+
* - Baseline is the first JIT compilation tier. It's the least optimized, but the fastest to compile
|
|
182
|
+
* - DFG means "Data Flow Graph", which is the second JIT compilation tier. It has some optimizations, but is slower to compile
|
|
183
|
+
* - FTL means "Faster Than Light", which is the third JIT compilation tier. It has the most optimizations, but is the slowest to compile
|
|
184
|
+
*/
|
|
185
|
+
function profile<T extends (...args: any[]) => any>(
|
|
186
|
+
callback: T,
|
|
187
|
+
sampleInterval?: number,
|
|
188
|
+
...args: Parameters<T>
|
|
189
|
+
): ReturnType<T> extends Promise<infer U> ? Promise<SamplingProfile> : SamplingProfile;
|
|
202
190
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
191
|
+
/**
|
|
192
|
+
* This returns objects which native code has explicitly protected from being
|
|
193
|
+
* garbage collected
|
|
194
|
+
*
|
|
195
|
+
* By calling this function you create another reference to the object, which
|
|
196
|
+
* will further prevent it from being garbage collected
|
|
197
|
+
*
|
|
198
|
+
* This function is mostly a debugging tool for bun itself.
|
|
199
|
+
*
|
|
200
|
+
* Warning: not all objects returned are supposed to be observable from JavaScript
|
|
201
|
+
*/
|
|
202
|
+
function getProtectedObjects(): any[];
|
|
215
203
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
204
|
+
/**
|
|
205
|
+
* Start a remote debugging socket server on the given port.
|
|
206
|
+
*
|
|
207
|
+
* This exposes JavaScriptCore's built-in debugging server.
|
|
208
|
+
*
|
|
209
|
+
* This is untested. May not be supported yet on macOS
|
|
210
|
+
*/
|
|
211
|
+
function startRemoteDebugger(host?: string, port?: number): void;
|
|
224
212
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
213
|
+
/**
|
|
214
|
+
* Run JavaScriptCore's sampling profiler
|
|
215
|
+
*/
|
|
216
|
+
function startSamplingProfiler(optionalDirectory?: string): void;
|
|
229
217
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
value: object | CallableFunction | bigint | symbol | string,
|
|
242
|
-
): number;
|
|
218
|
+
/**
|
|
219
|
+
* Non-recursively estimate the memory usage of an object, excluding the memory usage of
|
|
220
|
+
* properties or other objects it references. For more accurate per-object
|
|
221
|
+
* memory usage, use {@link Bun.generateHeapSnapshot}.
|
|
222
|
+
*
|
|
223
|
+
* This is a best-effort estimate. It may not be 100% accurate. When it's
|
|
224
|
+
* wrong, it may mean the memory is non-contiguous (such as a large array).
|
|
225
|
+
*
|
|
226
|
+
* Passing a primitive type that isn't heap allocated returns 0.
|
|
227
|
+
*/
|
|
228
|
+
function estimateShallowMemoryUsageOf(value: object | CallableFunction | bigint | symbol | string): number;
|
|
243
229
|
}
|
package/overrides.d.ts
CHANGED
|
@@ -1,74 +1,117 @@
|
|
|
1
1
|
export {};
|
|
2
2
|
|
|
3
|
-
import type { BunFile, Env, PathLike } from "bun";
|
|
4
|
-
|
|
5
3
|
declare global {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
namespace NodeJS {
|
|
5
|
+
interface Process {
|
|
6
|
+
readonly version: string;
|
|
7
|
+
browser: boolean;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Whether you are using Bun
|
|
11
|
+
*/
|
|
12
|
+
isBun: true;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The current git sha of Bun
|
|
16
|
+
*/
|
|
17
|
+
revision: string;
|
|
18
|
+
|
|
19
|
+
reallyExit(code?: number): never;
|
|
20
|
+
dlopen(module: { exports: any }, filename: string, flags?: number): void;
|
|
21
|
+
_exiting: boolean;
|
|
22
|
+
noDeprecation: boolean;
|
|
23
|
+
|
|
24
|
+
binding(m: "constants"): {
|
|
25
|
+
os: typeof import("node:os").constants;
|
|
26
|
+
fs: typeof import("node:fs").constants;
|
|
27
|
+
crypto: typeof import("node:crypto").constants;
|
|
28
|
+
zlib: typeof import("node:zlib").constants;
|
|
29
|
+
trace: {
|
|
30
|
+
TRACE_EVENT_PHASE_BEGIN: number;
|
|
31
|
+
TRACE_EVENT_PHASE_END: number;
|
|
32
|
+
TRACE_EVENT_PHASE_COMPLETE: number;
|
|
33
|
+
TRACE_EVENT_PHASE_INSTANT: number;
|
|
34
|
+
TRACE_EVENT_PHASE_ASYNC_BEGIN: number;
|
|
35
|
+
TRACE_EVENT_PHASE_ASYNC_STEP_INTO: number;
|
|
36
|
+
TRACE_EVENT_PHASE_ASYNC_STEP_PAST: number;
|
|
37
|
+
TRACE_EVENT_PHASE_ASYNC_END: number;
|
|
38
|
+
TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN: number;
|
|
39
|
+
TRACE_EVENT_PHASE_NESTABLE_ASYNC_END: number;
|
|
40
|
+
TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT: number;
|
|
41
|
+
TRACE_EVENT_PHASE_FLOW_BEGIN: number;
|
|
42
|
+
TRACE_EVENT_PHASE_FLOW_STEP: number;
|
|
43
|
+
TRACE_EVENT_PHASE_FLOW_END: number;
|
|
44
|
+
TRACE_EVENT_PHASE_METADATA: number;
|
|
45
|
+
TRACE_EVENT_PHASE_COUNTER: number;
|
|
46
|
+
TRACE_EVENT_PHASE_SAMPLE: number;
|
|
47
|
+
TRACE_EVENT_PHASE_CREATE_OBJECT: number;
|
|
48
|
+
TRACE_EVENT_PHASE_SNAPSHOT_OBJECT: number;
|
|
49
|
+
TRACE_EVENT_PHASE_DELETE_OBJECT: number;
|
|
50
|
+
TRACE_EVENT_PHASE_MEMORY_DUMP: number;
|
|
51
|
+
TRACE_EVENT_PHASE_MARK: number;
|
|
52
|
+
TRACE_EVENT_PHASE_CLOCK_SYNC: number;
|
|
53
|
+
TRACE_EVENT_PHASE_ENTER_CONTEXT: number;
|
|
54
|
+
TRACE_EVENT_PHASE_LEAVE_CONTEXT: number;
|
|
55
|
+
TRACE_EVENT_PHASE_LINK_IDS: number;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
binding(m: string): object;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface ProcessVersions extends Dict<string> {
|
|
62
|
+
bun: string;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
12
65
|
}
|
|
13
66
|
|
|
14
67
|
declare module "fs/promises" {
|
|
15
|
-
|
|
68
|
+
function exists(path: Bun.PathLike): Promise<boolean>;
|
|
16
69
|
}
|
|
17
70
|
|
|
18
71
|
declare module "tls" {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
| string
|
|
63
|
-
| Buffer
|
|
64
|
-
| BunFile
|
|
65
|
-
| NodeJS.TypedArray
|
|
66
|
-
| Array<string | Buffer | BunFile | NodeJS.TypedArray | KeyObject>
|
|
67
|
-
| undefined;
|
|
68
|
-
}
|
|
72
|
+
interface BunConnectionOptions extends Omit<ConnectionOptions, "key" | "ca" | "tls" | "cert"> {
|
|
73
|
+
/**
|
|
74
|
+
* Optionally override the trusted CA certificates. Default is to trust
|
|
75
|
+
* the well-known CAs curated by Mozilla. Mozilla's CAs are completely
|
|
76
|
+
* replaced when CAs are explicitly specified using this option.
|
|
77
|
+
*/
|
|
78
|
+
ca?: string | Buffer | NodeJS.TypedArray | Bun.BunFile | Array<string | Buffer | Bun.BunFile> | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Cert chains in PEM format. One cert chain should be provided per
|
|
81
|
+
* private key. Each cert chain should consist of the PEM formatted
|
|
82
|
+
* certificate for a provided private key, followed by the PEM
|
|
83
|
+
* formatted intermediate certificates (if any), in order, and not
|
|
84
|
+
* including the root CA (the root CA must be pre-known to the peer,
|
|
85
|
+
* see ca). When providing multiple cert chains, they do not have to
|
|
86
|
+
* be in the same order as their private keys in key. If the
|
|
87
|
+
* intermediate certificates are not provided, the peer will not be
|
|
88
|
+
* able to validate the certificate, and the handshake will fail.
|
|
89
|
+
*/
|
|
90
|
+
cert?:
|
|
91
|
+
| string
|
|
92
|
+
| Buffer
|
|
93
|
+
| NodeJS.TypedArray
|
|
94
|
+
| Bun.BunFile
|
|
95
|
+
| Array<string | Buffer | NodeJS.TypedArray | Bun.BunFile>
|
|
96
|
+
| undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Private keys in PEM format. PEM allows the option of private keys
|
|
99
|
+
* being encrypted. Encrypted keys will be decrypted with
|
|
100
|
+
* options.passphrase. Multiple keys using different algorithms can be
|
|
101
|
+
* provided either as an array of unencrypted key strings or buffers,
|
|
102
|
+
* or an array of objects in the form {pem: <string|buffer>[,
|
|
103
|
+
* passphrase: <string>]}. The object form can only occur in an array.
|
|
104
|
+
* object.passphrase is optional. Encrypted keys will be decrypted with
|
|
105
|
+
* object.passphrase if provided, or options.passphrase if it is not.
|
|
106
|
+
*/
|
|
107
|
+
key?:
|
|
108
|
+
| string
|
|
109
|
+
| Buffer
|
|
110
|
+
| Bun.BunFile
|
|
111
|
+
| NodeJS.TypedArray
|
|
112
|
+
| Array<string | Buffer | Bun.BunFile | NodeJS.TypedArray | KeyObject>
|
|
113
|
+
| undefined;
|
|
114
|
+
}
|
|
69
115
|
|
|
70
|
-
|
|
71
|
-
options: BunConnectionOptions,
|
|
72
|
-
secureConnectListener?: () => void,
|
|
73
|
-
): TLSSocket;
|
|
116
|
+
function connect(options: BunConnectionOptions, secureConnectListener?: () => void): TLSSocket;
|
|
74
117
|
}
|