@bytecodealliance/preview2-shim 0.0.14 → 0.0.16

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.
Files changed (70) hide show
  1. package/lib/browser/http.js +1 -1
  2. package/lib/browser/io.js +14 -3
  3. package/lib/http/error.js +1 -1
  4. package/lib/http/make-request.js +2 -2
  5. package/lib/http/wasi-http.js +62 -39
  6. package/lib/nodejs/io.js +16 -5
  7. package/package.json +1 -1
  8. package/types/{exports → interfaces}/wasi-cli-environment.d.ts +1 -1
  9. package/types/{imports → interfaces}/wasi-cli-stderr.d.ts +1 -1
  10. package/types/{exports → interfaces}/wasi-cli-stdin.d.ts +1 -1
  11. package/types/{imports → interfaces}/wasi-cli-stdout.d.ts +1 -1
  12. package/types/{imports → interfaces}/wasi-cli-terminal-stderr.d.ts +2 -2
  13. package/types/{imports → interfaces}/wasi-cli-terminal-stdin.d.ts +2 -2
  14. package/types/{imports → interfaces}/wasi-cli-terminal-stdout.d.ts +2 -2
  15. package/types/{imports → interfaces}/wasi-clocks-monotonic-clock.d.ts +1 -1
  16. package/types/{exports → interfaces}/wasi-clocks-timezone.d.ts +1 -1
  17. package/types/{exports → interfaces}/wasi-filesystem-preopens.d.ts +1 -1
  18. package/types/{imports → interfaces}/wasi-filesystem-types.d.ts +5 -5
  19. package/types/interfaces/wasi-io-streams.d.ts +274 -0
  20. package/types/{imports → interfaces}/wasi-sockets-instance-network.d.ts +1 -1
  21. package/types/{exports → interfaces}/wasi-sockets-ip-name-lookup.d.ts +7 -7
  22. package/types/{imports → interfaces}/wasi-sockets-tcp-create-socket.d.ts +4 -4
  23. package/types/{imports → interfaces}/wasi-sockets-tcp.d.ts +20 -7
  24. package/types/{exports → interfaces}/wasi-sockets-udp-create-socket.d.ts +4 -4
  25. package/types/{exports → interfaces}/wasi-sockets-udp.d.ts +5 -5
  26. package/types/wasi-cli-command.d.ts +28 -28
  27. package/types/exports/wasi-cli-stderr.d.ts +0 -5
  28. package/types/exports/wasi-cli-stdout.d.ts +0 -5
  29. package/types/exports/wasi-cli-terminal-stderr.d.ts +0 -9
  30. package/types/exports/wasi-cli-terminal-stdin.d.ts +0 -9
  31. package/types/exports/wasi-cli-terminal-stdout.d.ts +0 -9
  32. package/types/exports/wasi-clocks-monotonic-clock.d.ts +0 -24
  33. package/types/exports/wasi-filesystem-types.d.ts +0 -843
  34. package/types/exports/wasi-http-incoming-handler.d.ts +0 -7
  35. package/types/exports/wasi-http-outgoing-handler.d.ts +0 -9
  36. package/types/exports/wasi-http-types.d.ts +0 -118
  37. package/types/exports/wasi-io-streams.d.ts +0 -220
  38. package/types/exports/wasi-sockets-instance-network.d.ts +0 -8
  39. package/types/exports/wasi-sockets-tcp-create-socket.d.ts +0 -33
  40. package/types/exports/wasi-sockets-tcp.d.ts +0 -285
  41. package/types/imports/wasi-cli-environment.d.ts +0 -22
  42. package/types/imports/wasi-cli-exit.d.ts +0 -7
  43. package/types/imports/wasi-cli-stdin.d.ts +0 -5
  44. package/types/imports/wasi-cli-terminal-input.d.ts +0 -13
  45. package/types/imports/wasi-cli-terminal-output.d.ts +0 -13
  46. package/types/imports/wasi-clocks-timezone.d.ts +0 -71
  47. package/types/imports/wasi-clocks-wall-clock.d.ts +0 -31
  48. package/types/imports/wasi-filesystem-preopens.d.ts +0 -8
  49. package/types/imports/wasi-http-outgoing-handler.d.ts +0 -9
  50. package/types/imports/wasi-http-types.d.ts +0 -118
  51. package/types/imports/wasi-io-streams.d.ts +0 -220
  52. package/types/imports/wasi-poll-poll.d.ts +0 -39
  53. package/types/imports/wasi-random-insecure-seed.d.ts +0 -22
  54. package/types/imports/wasi-random-insecure.d.ts +0 -20
  55. package/types/imports/wasi-random-random.d.ts +0 -22
  56. package/types/imports/wasi-sockets-ip-name-lookup.d.ts +0 -76
  57. package/types/imports/wasi-sockets-network.d.ts +0 -180
  58. package/types/imports/wasi-sockets-udp-create-socket.d.ts +0 -33
  59. package/types/imports/wasi-sockets-udp.d.ts +0 -228
  60. package/types/wasi-http-proxy.d.ts +0 -13
  61. /package/types/{exports → interfaces}/wasi-cli-exit.d.ts +0 -0
  62. /package/types/{exports → interfaces}/wasi-cli-run.d.ts +0 -0
  63. /package/types/{exports → interfaces}/wasi-cli-terminal-input.d.ts +0 -0
  64. /package/types/{exports → interfaces}/wasi-cli-terminal-output.d.ts +0 -0
  65. /package/types/{exports → interfaces}/wasi-clocks-wall-clock.d.ts +0 -0
  66. /package/types/{exports → interfaces}/wasi-poll-poll.d.ts +0 -0
  67. /package/types/{exports → interfaces}/wasi-random-insecure-seed.d.ts +0 -0
  68. /package/types/{exports → interfaces}/wasi-random-insecure.d.ts +0 -0
  69. /package/types/{exports → interfaces}/wasi-random-random.d.ts +0 -0
  70. /package/types/{exports → interfaces}/wasi-sockets-network.d.ts +0 -0
@@ -1,7 +1,7 @@
1
1
  import { UnexpectedError } from "../http/error.js";
2
2
 
3
3
  /**
4
- * @param {import("../../types/imports/wasi-http-types").Request} req
4
+ * @param {import("../../types/interfaces/wasi-http-types").Request} req
5
5
  * @returns {string}
6
6
  */
7
7
  export function send(req) {
package/lib/browser/io.js CHANGED
@@ -89,11 +89,22 @@ export const streams = {
89
89
  dropInputStream(s) {
90
90
  console.log(`[streams] Drop input stream ${s}`);
91
91
  },
92
+ checkWrite(_s) {
93
+ // TODO: implement
94
+ return 1000000n;
95
+ },
92
96
  write(s, buf) {
93
- return [BigInt(getStream(s).write(buf)), 'ended'];
97
+ getStream(s).write(buf);
98
+ },
99
+ blockingWriteAndFlush(s, buf) {
100
+ // TODO: implement
101
+ return streams.write(s, buf);
102
+ },
103
+ flush(s) {
104
+ return streams.blockingFlush(s);
94
105
  },
95
- blockingWrite(s, buf) {
96
- return [BigInt(getStream(s).write(buf)), 'ended'];
106
+ blockingFlush(_s) {
107
+ // TODO: implement
97
108
  },
98
109
  writeZeroes(s, _len) {
99
110
  console.log(`[streams] Write zeroes ${s}`);
package/lib/http/error.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export class UnexpectedError extends Error {
2
- /** @type { import("../../types/imports/wasi-http-types").ErrorUnexpectedError } */
2
+ /** @type { import("../../types/interfaces/wasi-http-types").ErrorUnexpectedError } */
3
3
  payload;
4
4
  constructor(message = "unexpected-error") {
5
5
  super(message);
@@ -1,7 +1,7 @@
1
1
  import { runAsWorker } from "./synckit/index.js";
2
2
 
3
3
  /**
4
- * @param {import("../../types/imports/wasi-http-types").Request} req
4
+ * @param {import("../../types/interfaces/wasi-http-types").Request} req
5
5
  * @returns {Promise<string>}
6
6
  */
7
7
  async function makeRequest(req) {
@@ -16,7 +16,7 @@ async function makeRequest(req) {
16
16
  let arrayBuffer = await resp.arrayBuffer();
17
17
  return JSON.stringify({
18
18
  status: resp.status,
19
- headers: Array.from(resp.headers.entries()),
19
+ headers: Array.from(resp.headers),
20
20
  body:
21
21
  arrayBuffer.byteLength > 0
22
22
  ? Buffer.from(arrayBuffer).toString("base64")
@@ -2,18 +2,18 @@
2
2
  // https://github.com/bytecodealliance/wasmtime/blob/8efcb9851602287fd07a1a1e91501f51f2653d7e/crates/wasi-http/
3
3
 
4
4
  /**
5
- * @typedef {import("../../types/imports/wasi-http-types").Fields} Fields
6
- * @typedef {import("../../types/imports/wasi-http-types").FutureIncomingResponse} FutureIncomingResponse
7
- * @typedef {import("../../types/imports/wasi-http-types").Headers} Headers
8
- * @typedef {import("../../types/imports/wasi-http-types").IncomingResponse} IncomingResponse
9
- * @typedef {import("../../types/imports/wasi-http-types").IncomingStream} IncomingStream
10
- * @typedef {import("../../types/imports/wasi-http-types").Method} Method
11
- * @typedef {import("../../types/imports/wasi-http-types").OutgoingRequest} OutgoingRequest
12
- * @typedef {import("../../types/imports/wasi-http-types").RequestOptions} RequestOptions
13
- * @typedef {import("../../types/imports/wasi-http-types").Result} Result
14
- * @typedef {import("../../types/imports/wasi-http-types").Scheme} Scheme
15
- * @typedef {import("../../types/imports/wasi-http-types").StatusCode} StatusCode
16
- * @typedef {import("../../types/imports/wasi-io-streams").StreamStatus} StreamStatus
5
+ * @typedef {import("../../types/interfaces/wasi-http-types").Fields} Fields
6
+ * @typedef {import("../../types/interfaces/wasi-http-types").FutureIncomingResponse} FutureIncomingResponse
7
+ * @typedef {import("../../types/interfaces/wasi-http-types").Headers} Headers
8
+ * @typedef {import("../../types/interfaces/wasi-http-types").IncomingResponse} IncomingResponse
9
+ * @typedef {import("../../types/interfaces/wasi-http-types").IncomingStream} IncomingStream
10
+ * @typedef {import("../../types/interfaces/wasi-http-types").Method} Method
11
+ * @typedef {import("../../types/interfaces/wasi-http-types").OutgoingRequest} OutgoingRequest
12
+ * @typedef {import("../../types/interfaces/wasi-http-types").RequestOptions} RequestOptions
13
+ * @typedef {import("../../types/interfaces/wasi-http-types").Result} Result
14
+ * @typedef {import("../../types/interfaces/wasi-http-types").Scheme} Scheme
15
+ * @typedef {import("../../types/interfaces/wasi-http-types").StatusCode} StatusCode
16
+ * @typedef {import("../../types/interfaces/wasi-io-streams").StreamStatus} StreamStatus
17
17
  */
18
18
 
19
19
  import * as io from '@bytecodealliance/preview2-shim/io';
@@ -28,7 +28,7 @@ export class WasiHttp {
28
28
  futureIdBase = 1;
29
29
  /** @type {Map<number,ActiveRequest>} */ requests = new Map();
30
30
  /** @type {Map<number,ActiveResponse>} */ responses = new Map();
31
- /** @type {Map<number,Map<string,string[]>>} */ fields = new Map();
31
+ /** @type {Map<number,ActiveFields>} */ fields = new Map();
32
32
  /** @type {Map<number,Uint8Array>} */ streams = new Map();
33
33
  /** @type {Map<number,ActiveFuture>} */ futures = new Map();
34
34
 
@@ -53,9 +53,11 @@ export class WasiHttp {
53
53
  const headers = {
54
54
  "host": request.authority,
55
55
  };
56
- if (request.headers && request.headers.size > 0) {
57
- for (const [key, value] of request.headers.entries()) {
58
- headers[key] = Array.isArray(value) ? value.join(",") : value;
56
+ if (request.headers) {
57
+ const requestHeaders = this.fields.get(request.headers);
58
+ const decoder = new TextDecoder();
59
+ for (const [key, value] of requestHeaders.fields.entries()) {
60
+ headers[key] = decoder.decode(value);
59
61
  }
60
62
  }
61
63
  const body = this.streams.get(request.body);
@@ -69,10 +71,8 @@ export class WasiHttp {
69
71
  });
70
72
 
71
73
  response.status = res.status;
72
- if (res.headers && res.headers.size > 0) {
73
- for (const [key, value] of res.headers) {
74
- response.responseHeaders.set(key, [value]);
75
- }
74
+ if (res.headers && res.headers.length > 0) {
75
+ response.headers = this.newFields(res.headers);
76
76
  }
77
77
  const buf = res.body;
78
78
  response.body = this.streamIdBase;
@@ -131,21 +131,38 @@ export class WasiHttp {
131
131
  s.set([]);
132
132
  }
133
133
 
134
- write = (stream, buf) => {
135
- return this.blockingWrite(stream, buf);
134
+ checkWrite = (stream) => {
135
+ // TODO: implement
136
+ return io.streams.checkWrite(stream);
136
137
  }
137
138
 
138
139
  /**
139
140
  * @param {OutputStream} stream
140
141
  * @param {Uint8Array} buf
141
- * @returns {[bigint, StreamStatus]}
142
142
  */
143
- blockingWrite = (stream, buf) => {
143
+ write = (stream, buf) => {
144
144
  if (stream < 3) {
145
- return io.streams.blockingWrite(stream, buf);
145
+ return io.streams.write(stream, buf);
146
146
  }
147
147
  this.streams.set(stream, buf);
148
- return [BigInt(buf.byteLength), 'ended'];
148
+ }
149
+
150
+ blockingWriteAndFlush = (stream, buf) => {
151
+ if (stream < 3) {
152
+ return io.streams.blockingWriteAndFlush(stream, buf);
153
+ }
154
+ // TODO: implement
155
+ }
156
+
157
+ flush = (stream) => {
158
+ return this.blockingFlush(stream);
159
+ }
160
+
161
+ blockingFlush = (stream) => {
162
+ if (stream < 3) {
163
+ return io.streams.blockingFlush(stream);
164
+ }
165
+ // TODO: implement
149
166
  }
150
167
 
151
168
  /**
@@ -178,21 +195,20 @@ export class WasiHttp {
178
195
  * @returns {Fields}
179
196
  */
180
197
  newFields = (entries) => {
181
- const map = new Map(entries);
182
-
183
198
  const id = this.fieldsIdBase;
184
199
  this.fieldsIdBase += 1;
185
- this.fields.set(id, map);
200
+ this.fields.set(id, new ActiveFields(id, entries));
186
201
 
187
202
  return id;
188
203
  }
189
204
 
190
205
  /**
191
206
  * @param {Fields} fields
192
- * @returns {[string, string][]}
207
+ * @returns {[string, Uint8Array][]}
193
208
  */
194
209
  fieldsEntries = (fields) => {
195
- return this.fields.get(fields) ?? [];
210
+ const activeFields = this.fields.get(fields);
211
+ return activeFields ? Array.from(activeFields.fields) : [];
196
212
  }
197
213
 
198
214
  /**
@@ -218,7 +234,7 @@ export class WasiHttp {
218
234
  req.pathWithQuery = pathWithQuery;
219
235
  req.authority = authority;
220
236
  req.method = method;
221
- req.headers = this.fields.get(headers);
237
+ req.headers = headers;
222
238
  req.scheme = scheme;
223
239
  this.requests.set(id, req);
224
240
  return id;
@@ -257,11 +273,7 @@ export class WasiHttp {
257
273
  */
258
274
  incomingResponseHeaders = (response) => {
259
275
  const r = this.responses.get(response);
260
- const id = this.fieldsIdBase;
261
- this.fieldsIdBase += 1;
262
-
263
- this.fields.set(id, r.responseHeaders);
264
- return id;
276
+ return r.headers ?? 0;
265
277
  }
266
278
 
267
279
  /**
@@ -316,7 +328,7 @@ class ActiveRequest {
316
328
  /** @type {Scheme | null} */ scheme = { tag: 'HTTP' };
317
329
  pathWithQuery = null;
318
330
  authority = null;
319
- /** @type {Map<string,string[]>} */ headers = new Map();
331
+ /** @type {number | null} */ headers = null;
320
332
  body = 3;
321
333
 
322
334
  constructor(id) {
@@ -329,7 +341,7 @@ class ActiveResponse {
329
341
  activeResponse = false;
330
342
  status = 0;
331
343
  body = 3;
332
- /** @type {Map<string,string[]>} */ responseHeaders = new Map();
344
+ /** @type {number | null} */ headers = null;
333
345
 
334
346
  constructor(id) {
335
347
  this.id = id;
@@ -345,3 +357,14 @@ class ActiveFuture {
345
357
  this.responseId = responseId;
346
358
  }
347
359
  }
360
+
361
+ class ActiveFields {
362
+ /** @type {number} */ id;
363
+ /** @type {Map<string, Uint8Array[]>} */ fields;
364
+
365
+ constructor(id, fields) {
366
+ this.id = id;
367
+ const encoder = new TextEncoder();
368
+ this.fields = new Map(fields.map(([k, v]) => [k, encoder.encode(v)]));
369
+ }
370
+ }
package/lib/nodejs/io.js CHANGED
@@ -106,25 +106,36 @@ export const streams = {
106
106
  dropInputStream(s) {
107
107
  delete _streams[s];
108
108
  },
109
- write(s, buf) {
110
- return streams.blockingWrite(s, buf);
109
+ checkWrite(_s) {
110
+ // TODO: implement
111
+ return 1000000n;
111
112
  },
112
- blockingWrite(s, buf) {
113
+ write(s, buf) {
113
114
  switch (s) {
114
115
  case 0:
115
116
  throw new Error(`TODO: write stdin`);
116
117
  case 1: {
117
118
  process.stdout.write(buf);
118
- return [BigInt(buf.byteLength), 'ended'];
119
+ break;
119
120
  }
120
121
  case 2: {
121
122
  process.stderr.write(buf);
122
- return [BigInt(buf.byteLength), 'ended'];
123
+ break;
123
124
  }
124
125
  default:
125
126
  throw new Error(`TODO: write ${s}`);
126
127
  }
127
128
  },
129
+ blockingWriteAndFlush(s, buf) {
130
+ // TODO: implement
131
+ return streams.write(s, buf);
132
+ },
133
+ flush(s) {
134
+ return streams.blockingFlush(s);
135
+ },
136
+ blockingFlush(_s) {
137
+ // TODO: implement
138
+ },
128
139
  writeZeroes(s, _len) {
129
140
  console.log(`[streams] Write zeroes ${s}`);
130
141
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytecodealliance/preview2-shim",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "WASI Preview2 shim for JS environments",
5
5
  "author": "Guy Bedford, Eduardo Rodrigues<16357187+eduardomourar@users.noreply.github.com>",
6
6
  "type": "module",
@@ -18,5 +18,5 @@ export namespace WasiCliEnvironment {
18
18
  * Return a path that programs should use as their initial current working
19
19
  * directory, interpreting `.` as shorthand for this.
20
20
  */
21
- export function initialCwd(): string | null;
21
+ export function initialCwd(): string | undefined;
22
22
  }
@@ -1,5 +1,5 @@
1
1
  export namespace WasiCliStderr {
2
2
  export function getStderr(): OutputStream;
3
3
  }
4
- import type { OutputStream } from '../imports/wasi-io-streams';
4
+ import type { OutputStream } from '../interfaces/wasi-io-streams';
5
5
  export { OutputStream };
@@ -1,5 +1,5 @@
1
1
  export namespace WasiCliStdin {
2
2
  export function getStdin(): InputStream;
3
3
  }
4
- import type { InputStream } from '../exports/wasi-io-streams';
4
+ import type { InputStream } from '../interfaces/wasi-io-streams';
5
5
  export { InputStream };
@@ -1,5 +1,5 @@
1
1
  export namespace WasiCliStdout {
2
2
  export function getStdout(): OutputStream;
3
3
  }
4
- import type { OutputStream } from '../imports/wasi-io-streams';
4
+ import type { OutputStream } from '../interfaces/wasi-io-streams';
5
5
  export { OutputStream };
@@ -3,7 +3,7 @@ export namespace WasiCliTerminalStderr {
3
3
  * If stderr is connected to a terminal, return a `terminal-output` handle
4
4
  * allowing further interaction with it.
5
5
  */
6
- export function getTerminalStderr(): TerminalOutput | null;
6
+ export function getTerminalStderr(): TerminalOutput | undefined;
7
7
  }
8
- import type { TerminalOutput } from '../imports/wasi-cli-terminal-output';
8
+ import type { TerminalOutput } from '../interfaces/wasi-cli-terminal-output';
9
9
  export { TerminalOutput };
@@ -3,7 +3,7 @@ export namespace WasiCliTerminalStdin {
3
3
  * If stdin is connected to a terminal, return a `terminal-input` handle
4
4
  * allowing further interaction with it.
5
5
  */
6
- export function getTerminalStdin(): TerminalInput | null;
6
+ export function getTerminalStdin(): TerminalInput | undefined;
7
7
  }
8
- import type { TerminalInput } from '../imports/wasi-cli-terminal-input';
8
+ import type { TerminalInput } from '../interfaces/wasi-cli-terminal-input';
9
9
  export { TerminalInput };
@@ -3,7 +3,7 @@ export namespace WasiCliTerminalStdout {
3
3
  * If stdout is connected to a terminal, return a `terminal-output` handle
4
4
  * allowing further interaction with it.
5
5
  */
6
- export function getTerminalStdout(): TerminalOutput | null;
6
+ export function getTerminalStdout(): TerminalOutput | undefined;
7
7
  }
8
- import type { TerminalOutput } from '../imports/wasi-cli-terminal-output';
8
+ import type { TerminalOutput } from '../interfaces/wasi-cli-terminal-output';
9
9
  export { TerminalOutput };
@@ -16,7 +16,7 @@ export namespace WasiClocksMonotonicClock {
16
16
  */
17
17
  export function subscribe(when: Instant, absolute: boolean): Pollable;
18
18
  }
19
- import type { Pollable } from '../imports/wasi-poll-poll';
19
+ import type { Pollable } from '../interfaces/wasi-poll-poll';
20
20
  export { Pollable };
21
21
  /**
22
22
  * A timestamp in nanoseconds.
@@ -19,7 +19,7 @@ export namespace WasiClocksTimezone {
19
19
  */
20
20
  export function dropTimezone(this_: Timezone): void;
21
21
  }
22
- import type { Datetime } from '../exports/wasi-clocks-wall-clock';
22
+ import type { Datetime } from '../interfaces/wasi-clocks-wall-clock';
23
23
  export { Datetime };
24
24
  /**
25
25
  * A timezone.
@@ -4,5 +4,5 @@ export namespace WasiFilesystemPreopens {
4
4
  */
5
5
  export function getDirectories(): [Descriptor, string][];
6
6
  }
7
- import type { Descriptor } from '../exports/wasi-filesystem-types';
7
+ import type { Descriptor } from '../interfaces/wasi-filesystem-types';
8
8
  export { Descriptor };
@@ -93,7 +93,7 @@ export namespace WasiFilesystemTypes {
93
93
  *
94
94
  * Note: This is similar to `pread` in POSIX.
95
95
  */
96
- export function read(this_: Descriptor, length: Filesize, offset: Filesize): [Uint8Array | ArrayBuffer, boolean];
96
+ export function read(this_: Descriptor, length: Filesize, offset: Filesize): [Uint8Array, boolean];
97
97
  /**
98
98
  * Write to a descriptor, without using and updating the descriptor's offset.
99
99
  *
@@ -377,7 +377,7 @@ export namespace WasiFilesystemTypes {
377
377
  /**
378
378
  * Read a single directory entry from a `directory-entry-stream`.
379
379
  */
380
- export function readDirectoryEntry(this_: DirectoryEntryStream): DirectoryEntry | null;
380
+ export function readDirectoryEntry(this_: DirectoryEntryStream): DirectoryEntry | undefined;
381
381
  /**
382
382
  * Dispose of the specified `directory-entry-stream`, after which it may no longer
383
383
  * be used.
@@ -422,11 +422,11 @@ export namespace WasiFilesystemTypes {
422
422
  */
423
423
  export function metadataHashAt(this_: Descriptor, pathFlags: PathFlags, path: string): MetadataHashValue;
424
424
  }
425
- import type { InputStream } from '../imports/wasi-io-streams';
425
+ import type { InputStream } from '../interfaces/wasi-io-streams';
426
426
  export { InputStream };
427
- import type { OutputStream } from '../imports/wasi-io-streams';
427
+ import type { OutputStream } from '../interfaces/wasi-io-streams';
428
428
  export { OutputStream };
429
- import type { Datetime } from '../imports/wasi-clocks-wall-clock';
429
+ import type { Datetime } from '../interfaces/wasi-clocks-wall-clock';
430
430
  export { Datetime };
431
431
  /**
432
432
  * File size or length of a region within a file.