bun-types 1.2.6 → 1.2.8-canary.20250327T140605
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 +7187 -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/wasm.d.ts
CHANGED
|
@@ -1,291 +1,193 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type
|
|
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
|
-
|
|
1
|
+
declare module "bun" {
|
|
2
|
+
namespace WebAssembly {
|
|
3
|
+
type ImportExportKind = "function" | "global" | "memory" | "table";
|
|
4
|
+
type TableKind = "anyfunc" | "externref";
|
|
5
|
+
type ExportValue = Function | Global | WebAssembly.Memory | WebAssembly.Table;
|
|
6
|
+
type Exports = Record<string, ExportValue>;
|
|
7
|
+
type ImportValue = ExportValue | number;
|
|
8
|
+
type Imports = Record<string, ModuleImports>;
|
|
9
|
+
type ModuleImports = Record<string, ImportValue>;
|
|
10
|
+
|
|
11
|
+
interface ValueTypeMap {
|
|
12
|
+
anyfunc: Function;
|
|
13
|
+
externref: any;
|
|
14
|
+
f32: number;
|
|
15
|
+
f64: number;
|
|
16
|
+
i32: number;
|
|
17
|
+
i64: bigint;
|
|
18
|
+
v128: never;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type ValueType = keyof ValueTypeMap;
|
|
22
|
+
|
|
23
|
+
interface GlobalDescriptor<T extends ValueType = ValueType> {
|
|
24
|
+
mutable?: boolean;
|
|
25
|
+
value: T;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface Global<T extends ValueType = ValueType> {
|
|
29
|
+
// <T extends ValueType = ValueType> {
|
|
30
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global/value) */
|
|
31
|
+
value: ValueTypeMap[T];
|
|
32
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global/valueOf) */
|
|
33
|
+
valueOf(): ValueTypeMap[T];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface CompileError extends Error {}
|
|
37
|
+
|
|
38
|
+
interface LinkError extends Error {}
|
|
39
|
+
|
|
40
|
+
interface RuntimeError extends Error {}
|
|
41
|
+
|
|
42
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance) */
|
|
43
|
+
interface Instance {
|
|
44
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance/exports) */
|
|
45
|
+
readonly exports: Exports;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) */
|
|
49
|
+
interface Memory {
|
|
50
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory/buffer) */
|
|
51
|
+
readonly buffer: ArrayBuffer;
|
|
52
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory/grow) */
|
|
53
|
+
grow(delta: number): number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module) */
|
|
57
|
+
interface Module {}
|
|
58
|
+
|
|
59
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table) */
|
|
60
|
+
interface Table {
|
|
61
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/length) */
|
|
62
|
+
readonly length: number;
|
|
63
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/get) */
|
|
64
|
+
get(index: number): any;
|
|
65
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/grow) */
|
|
66
|
+
grow(delta: number, value?: any): number;
|
|
67
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/set) */
|
|
68
|
+
set(index: number, value?: any): void;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
interface MemoryDescriptor {
|
|
72
|
+
initial: number;
|
|
73
|
+
maximum?: number;
|
|
74
|
+
shared?: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface ModuleExportDescriptor {
|
|
78
|
+
kind: ImportExportKind;
|
|
79
|
+
name: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface ModuleImportDescriptor {
|
|
83
|
+
kind: ImportExportKind;
|
|
84
|
+
module: string;
|
|
85
|
+
name: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface TableDescriptor {
|
|
89
|
+
element: TableKind;
|
|
90
|
+
initial: number;
|
|
91
|
+
maximum?: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface WebAssemblyInstantiatedSource {
|
|
95
|
+
instance: Instance;
|
|
96
|
+
module: Module;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
42
99
|
}
|
|
43
|
-
? T
|
|
44
|
-
: Bun.WebAssembly.Instance;
|
|
45
|
-
|
|
46
|
-
type _Module = typeof globalThis extends {
|
|
47
|
-
onerror: any;
|
|
48
|
-
WebAssembly: { Module: infer T };
|
|
49
|
-
}
|
|
50
|
-
? T
|
|
51
|
-
: Bun.WebAssembly.Module;
|
|
52
|
-
|
|
53
|
-
type _Table = typeof globalThis extends {
|
|
54
|
-
onerror: any;
|
|
55
|
-
WebAssembly: { Table: infer T };
|
|
56
|
-
}
|
|
57
|
-
? T
|
|
58
|
-
: Bun.WebAssembly.Table;
|
|
59
|
-
|
|
60
|
-
declare global {
|
|
61
|
-
namespace Bun {
|
|
62
|
-
namespace WebAssembly {
|
|
63
|
-
type ImportExportKind = "function" | "global" | "memory" | "table";
|
|
64
|
-
type TableKind = "anyfunc" | "externref";
|
|
65
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
66
|
-
type ExportValue =
|
|
67
|
-
| Function
|
|
68
|
-
| Global
|
|
69
|
-
| WebAssembly.Memory
|
|
70
|
-
| WebAssembly.Table;
|
|
71
|
-
type Exports = Record<string, ExportValue>;
|
|
72
|
-
type ImportValue = ExportValue | number;
|
|
73
|
-
type Imports = Record<string, ModuleImports>;
|
|
74
|
-
type ModuleImports = Record<string, ImportValue>;
|
|
75
|
-
|
|
76
|
-
interface ValueTypeMap {
|
|
77
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
78
|
-
anyfunc: Function;
|
|
79
|
-
externref: any;
|
|
80
|
-
f32: number;
|
|
81
|
-
f64: number;
|
|
82
|
-
i32: number;
|
|
83
|
-
i64: bigint;
|
|
84
|
-
v128: never;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
type ValueType = keyof ValueTypeMap;
|
|
88
|
-
|
|
89
|
-
interface GlobalDescriptor<T extends ValueType = ValueType> {
|
|
90
|
-
mutable?: boolean;
|
|
91
|
-
value: T;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
interface Global<T extends ValueType = ValueType> {
|
|
95
|
-
// <T extends ValueType = ValueType> {
|
|
96
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global/value) */
|
|
97
|
-
value: ValueTypeMap[T];
|
|
98
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global/valueOf) */
|
|
99
|
-
valueOf(): ValueTypeMap[T];
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
interface CompileError extends Error {}
|
|
103
|
-
|
|
104
|
-
interface LinkError extends Error {}
|
|
105
|
-
|
|
106
|
-
interface RuntimeError extends Error {}
|
|
107
|
-
|
|
108
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance) */
|
|
109
|
-
interface Instance {
|
|
110
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Instance/exports) */
|
|
111
|
-
readonly exports: Exports;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory) */
|
|
115
|
-
interface Memory {
|
|
116
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory/buffer) */
|
|
117
|
-
readonly buffer: ArrayBuffer;
|
|
118
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory/grow) */
|
|
119
|
-
grow(delta: number): number;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module) */
|
|
123
|
-
interface Module {}
|
|
124
|
-
|
|
125
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table) */
|
|
126
|
-
interface Table {
|
|
127
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/length) */
|
|
128
|
-
readonly length: number;
|
|
129
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/get) */
|
|
130
|
-
get(index: number): any;
|
|
131
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/grow) */
|
|
132
|
-
grow(delta: number, value?: any): number;
|
|
133
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/set) */
|
|
134
|
-
set(index: number, value?: any): void;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
interface MemoryDescriptor {
|
|
138
|
-
initial: number;
|
|
139
|
-
maximum?: number;
|
|
140
|
-
shared?: boolean;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
interface ModuleExportDescriptor {
|
|
144
|
-
kind: ImportExportKind;
|
|
145
|
-
name: string;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
interface ModuleImportDescriptor {
|
|
149
|
-
kind: ImportExportKind;
|
|
150
|
-
module: string;
|
|
151
|
-
name: string;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
interface TableDescriptor {
|
|
155
|
-
element: TableKind;
|
|
156
|
-
initial: number;
|
|
157
|
-
maximum?: number;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
interface WebAssemblyInstantiatedSource {
|
|
161
|
-
instance: Instance;
|
|
162
|
-
module: Module;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
namespace WebAssembly {
|
|
168
|
-
interface ValueTypeMap extends Bun.WebAssembly.ValueTypeMap {}
|
|
169
|
-
interface GlobalDescriptor<
|
|
170
|
-
T extends keyof ValueTypeMap = keyof ValueTypeMap,
|
|
171
|
-
> extends Bun.WebAssembly.GlobalDescriptor<T> {}
|
|
172
|
-
interface MemoryDescriptor extends Bun.WebAssembly.MemoryDescriptor {}
|
|
173
|
-
interface ModuleExportDescriptor
|
|
174
|
-
extends Bun.WebAssembly.ModuleExportDescriptor {}
|
|
175
|
-
interface ModuleImportDescriptor
|
|
176
|
-
extends Bun.WebAssembly.ModuleImportDescriptor {}
|
|
177
|
-
interface TableDescriptor extends Bun.WebAssembly.TableDescriptor {}
|
|
178
|
-
interface WebAssemblyInstantiatedSource
|
|
179
|
-
extends Bun.WebAssembly.WebAssemblyInstantiatedSource {}
|
|
180
|
-
|
|
181
|
-
interface LinkError extends _LinkError {}
|
|
182
|
-
var LinkError: {
|
|
183
|
-
prototype: LinkError;
|
|
184
|
-
new (message?: string): LinkError;
|
|
185
|
-
(message?: string): LinkError;
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
interface CompileError extends _CompileError {}
|
|
189
|
-
var CompileError: typeof globalThis extends {
|
|
190
|
-
onerror: any;
|
|
191
|
-
WebAssembly: { CompileError: infer T };
|
|
192
|
-
}
|
|
193
|
-
? T
|
|
194
|
-
: {
|
|
195
|
-
prototype: CompileError;
|
|
196
|
-
new (message?: string): CompileError;
|
|
197
|
-
(message?: string): CompileError;
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
interface RuntimeError extends _RuntimeError {}
|
|
201
|
-
var RuntimeError: {
|
|
202
|
-
prototype: RuntimeError;
|
|
203
|
-
new (message?: string): RuntimeError;
|
|
204
|
-
(message?: string): RuntimeError;
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
interface Global<T extends keyof ValueTypeMap = keyof ValueTypeMap>
|
|
208
|
-
extends _Global<T> {}
|
|
209
|
-
var Global: typeof globalThis extends {
|
|
210
|
-
onerror: any;
|
|
211
|
-
WebAssembly: { Global: infer T };
|
|
212
|
-
}
|
|
213
|
-
? T
|
|
214
|
-
: {
|
|
215
|
-
prototype: Global;
|
|
216
|
-
new <T extends Bun.WebAssembly.ValueType = Bun.WebAssembly.ValueType>(
|
|
217
|
-
descriptor: GlobalDescriptor<T>,
|
|
218
|
-
v?: ValueTypeMap[T],
|
|
219
|
-
): Global<T>;
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
interface Instance extends _Instance {}
|
|
223
|
-
var Instance: typeof globalThis extends {
|
|
224
|
-
onerror: any;
|
|
225
|
-
WebAssembly: { Instance: infer T };
|
|
226
|
-
}
|
|
227
|
-
? T
|
|
228
|
-
: {
|
|
229
|
-
prototype: Instance;
|
|
230
|
-
new (
|
|
231
|
-
module: Module,
|
|
232
|
-
importObject?: Bun.WebAssembly.Imports,
|
|
233
|
-
): Instance;
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
interface Memory extends _Memory {}
|
|
237
|
-
var Memory: {
|
|
238
|
-
prototype: Memory;
|
|
239
|
-
new (descriptor: MemoryDescriptor): Memory;
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
interface Module extends _Module {}
|
|
243
|
-
var Module: typeof globalThis extends {
|
|
244
|
-
onerror: any;
|
|
245
|
-
WebAssembly: { Module: infer T };
|
|
246
|
-
}
|
|
247
|
-
? T
|
|
248
|
-
: {
|
|
249
|
-
prototype: Module;
|
|
250
|
-
new (bytes: Bun.BufferSource): Module;
|
|
251
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/customSections) */
|
|
252
|
-
customSections(
|
|
253
|
-
moduleObject: Module,
|
|
254
|
-
sectionName: string,
|
|
255
|
-
): ArrayBuffer[];
|
|
256
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/exports) */
|
|
257
|
-
exports(moduleObject: Module): ModuleExportDescriptor[];
|
|
258
|
-
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/imports) */
|
|
259
|
-
imports(moduleObject: Module): ModuleImportDescriptor[];
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
interface Table extends _Table {}
|
|
263
|
-
var Table: {
|
|
264
|
-
prototype: Table;
|
|
265
|
-
new (descriptor: TableDescriptor, value?: any): Table;
|
|
266
|
-
};
|
|
267
100
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
101
|
+
declare namespace WebAssembly {
|
|
102
|
+
interface ValueTypeMap extends Bun.WebAssembly.ValueTypeMap {}
|
|
103
|
+
interface GlobalDescriptor<T extends keyof ValueTypeMap = keyof ValueTypeMap>
|
|
104
|
+
extends Bun.WebAssembly.GlobalDescriptor<T> {}
|
|
105
|
+
interface MemoryDescriptor extends Bun.WebAssembly.MemoryDescriptor {}
|
|
106
|
+
interface ModuleExportDescriptor extends Bun.WebAssembly.ModuleExportDescriptor {}
|
|
107
|
+
interface ModuleImportDescriptor extends Bun.WebAssembly.ModuleImportDescriptor {}
|
|
108
|
+
interface TableDescriptor extends Bun.WebAssembly.TableDescriptor {}
|
|
109
|
+
interface WebAssemblyInstantiatedSource extends Bun.WebAssembly.WebAssemblyInstantiatedSource {}
|
|
110
|
+
|
|
111
|
+
interface LinkError extends Bun.WebAssembly.LinkError {}
|
|
112
|
+
var LinkError: {
|
|
113
|
+
prototype: LinkError;
|
|
114
|
+
new (message?: string): LinkError;
|
|
115
|
+
(message?: string): LinkError;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
interface CompileError extends Bun.WebAssembly.CompileError {}
|
|
119
|
+
var CompileError: {
|
|
120
|
+
prototype: CompileError;
|
|
121
|
+
new (message?: string): CompileError;
|
|
122
|
+
(message?: string): CompileError;
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
interface RuntimeError extends Bun.WebAssembly.RuntimeError {}
|
|
126
|
+
var RuntimeError: {
|
|
127
|
+
prototype: RuntimeError;
|
|
128
|
+
new (message?: string): RuntimeError;
|
|
129
|
+
(message?: string): RuntimeError;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
interface Global<T extends keyof ValueTypeMap = keyof ValueTypeMap> extends Bun.WebAssembly.Global<T> {}
|
|
133
|
+
var Global: {
|
|
134
|
+
prototype: Global;
|
|
135
|
+
new <T extends Bun.WebAssembly.ValueType = Bun.WebAssembly.ValueType>(
|
|
136
|
+
descriptor: GlobalDescriptor<T>,
|
|
137
|
+
v?: ValueTypeMap[T],
|
|
138
|
+
): Global<T>;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
interface Instance extends Bun.WebAssembly.Instance {}
|
|
142
|
+
var Instance: {
|
|
143
|
+
prototype: Instance;
|
|
144
|
+
new (module: Module, importObject?: Bun.WebAssembly.Imports): Instance;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
interface Memory extends Bun.WebAssembly.Memory {}
|
|
148
|
+
var Memory: {
|
|
149
|
+
prototype: Memory;
|
|
150
|
+
new (descriptor: MemoryDescriptor): Memory;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
interface Module extends Bun.WebAssembly.Module {}
|
|
154
|
+
var Module: Bun.__internal.UseLibDomIfAvailable<
|
|
155
|
+
"WebAssembly",
|
|
156
|
+
{
|
|
157
|
+
Module: {
|
|
158
|
+
prototype: Module;
|
|
159
|
+
new (bytes: Bun.BufferSource): Module;
|
|
160
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/customSections) */
|
|
161
|
+
customSections(moduleObject: Module, sectionName: string): ArrayBuffer[];
|
|
162
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/exports) */
|
|
163
|
+
exports(moduleObject: Module): ModuleExportDescriptor[];
|
|
164
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/imports) */
|
|
165
|
+
imports(moduleObject: Module): ModuleImportDescriptor[];
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
>["Module"];
|
|
169
|
+
|
|
170
|
+
interface Table extends Bun.WebAssembly.Table {}
|
|
171
|
+
var Table: {
|
|
172
|
+
prototype: Table;
|
|
173
|
+
new (descriptor: TableDescriptor, value?: any): Table;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compile) */
|
|
177
|
+
function compile(bytes: Bun.BufferSource): Promise<Module>;
|
|
178
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/compileStreaming) */
|
|
179
|
+
function compileStreaming(source: Response | PromiseLike<Response>): Promise<Module>;
|
|
180
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiate) */
|
|
181
|
+
function instantiate(
|
|
182
|
+
bytes: Bun.BufferSource,
|
|
183
|
+
importObject?: Bun.WebAssembly.Imports,
|
|
184
|
+
): Promise<WebAssemblyInstantiatedSource>;
|
|
185
|
+
function instantiate(moduleObject: Module, importObject?: Bun.WebAssembly.Imports): Promise<Instance>;
|
|
186
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/instantiateStreaming) */
|
|
187
|
+
function instantiateStreaming(
|
|
188
|
+
source: Response | PromiseLike<Response>,
|
|
189
|
+
importObject?: Bun.WebAssembly.Imports,
|
|
190
|
+
): Promise<WebAssemblyInstantiatedSource>;
|
|
191
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/validate) */
|
|
192
|
+
function validate(bytes: Bun.BufferSource): boolean;
|
|
291
193
|
}
|
package/ambient.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
declare module "*.txt" {
|
|
2
|
-
var text: string;
|
|
3
|
-
export = text;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
declare module "*.toml" {
|
|
7
|
-
var contents: any;
|
|
8
|
-
export = contents;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
declare module "*.jsonc" {
|
|
12
|
-
var contents: any;
|
|
13
|
-
export = contents;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare module "*/bun.lock" {
|
|
17
|
-
var contents: import("bun").BunLockFile;
|
|
18
|
-
export = contents;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare module "*.html" {
|
|
22
|
-
// In Bun v1.2, we might change this to Bun.HTMLBundle
|
|
23
|
-
var contents: any;
|
|
24
|
-
export = contents;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
declare module "*.svg" {
|
|
28
|
-
// Bun 1.2.3 added support for frontend dev server
|
|
29
|
-
var contents: `${string}.svg`;
|
|
30
|
-
export = contents;
|
|
31
|
-
}
|