@bytecodealliance/preview2-shim 0.16.0 → 0.16.1
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/lib/io/worker-http.js +12 -9
- package/lib/nodejs/clocks.js +2 -2
- package/lib/nodejs/http.js +9 -19
- package/lib/nodejs/random.js +1 -1
- package/package.json +1 -1
- package/types/interfaces/wasi-cli-stderr.d.ts +1 -1
- package/types/interfaces/wasi-cli-stdin.d.ts +1 -1
- package/types/interfaces/wasi-cli-stdout.d.ts +1 -1
- package/types/interfaces/wasi-cli-terminal-stderr.d.ts +1 -1
- package/types/interfaces/wasi-cli-terminal-stdin.d.ts +1 -1
- package/types/interfaces/wasi-cli-terminal-stdout.d.ts +1 -1
- package/types/interfaces/wasi-clocks-monotonic-clock.d.ts +1 -1
- package/types/interfaces/wasi-filesystem-preopens.d.ts +1 -1
- package/types/interfaces/wasi-filesystem-types.d.ts +8 -8
- package/types/interfaces/wasi-http-incoming-handler.d.ts +2 -2
- package/types/interfaces/wasi-http-outgoing-handler.d.ts +4 -4
- package/types/interfaces/wasi-http-types.d.ts +50 -50
- package/types/interfaces/wasi-io-streams.d.ts +2 -2
- package/types/interfaces/wasi-sockets-instance-network.d.ts +1 -1
- package/types/interfaces/wasi-sockets-ip-name-lookup.d.ts +4 -4
- package/types/interfaces/wasi-sockets-tcp-create-socket.d.ts +4 -4
- package/types/interfaces/wasi-sockets-tcp.d.ts +8 -8
- package/types/interfaces/wasi-sockets-udp-create-socket.d.ts +4 -4
- package/types/interfaces/wasi-sockets-udp.d.ts +5 -5
package/lib/io/worker-http.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createReadableStream,
|
|
3
|
-
getStreamOrThrow,
|
|
4
|
-
} from "./worker-thread.js";
|
|
1
|
+
import { createReadableStream, getStreamOrThrow } from "./worker-thread.js";
|
|
5
2
|
import {
|
|
6
3
|
createServer,
|
|
7
4
|
request as httpRequest,
|
|
@@ -117,7 +114,7 @@ export async function createHttpRequest(
|
|
|
117
114
|
host: authority.split(":")[0],
|
|
118
115
|
port: authority.split(":")[1],
|
|
119
116
|
path: pathWithQuery,
|
|
120
|
-
timeout: connectTimeout && Number(connectTimeout),
|
|
117
|
+
timeout: connectTimeout && Number(connectTimeout / 1_000_000n),
|
|
121
118
|
});
|
|
122
119
|
break;
|
|
123
120
|
case "https:":
|
|
@@ -127,7 +124,7 @@ export async function createHttpRequest(
|
|
|
127
124
|
host: authority.split(":")[0],
|
|
128
125
|
port: authority.split(":")[1],
|
|
129
126
|
path: pathWithQuery,
|
|
130
|
-
timeout: connectTimeout && Number(connectTimeout),
|
|
127
|
+
timeout: connectTimeout && Number(connectTimeout / 1_000_000n),
|
|
131
128
|
});
|
|
132
129
|
break;
|
|
133
130
|
default:
|
|
@@ -143,20 +140,26 @@ export async function createHttpRequest(
|
|
|
143
140
|
req.end();
|
|
144
141
|
}
|
|
145
142
|
const res = await new Promise((resolve, reject) => {
|
|
143
|
+
req.once('timeout', () => {
|
|
144
|
+
reject({
|
|
145
|
+
tag: "connection-timeout"
|
|
146
|
+
});
|
|
147
|
+
req.destroy();
|
|
148
|
+
});
|
|
146
149
|
req.once("response", resolve);
|
|
147
150
|
req.once("close", () => reject);
|
|
148
151
|
req.once("error", reject);
|
|
149
152
|
});
|
|
150
|
-
if (firstByteTimeout) res.setTimeout(Number(firstByteTimeout));
|
|
153
|
+
if (firstByteTimeout) res.setTimeout(Number(firstByteTimeout / 1_000_000n));
|
|
151
154
|
if (betweenBytesTimeout)
|
|
152
155
|
res.once("readable", () => {
|
|
153
|
-
res.setTimeout(Number(betweenBytesTimeout));
|
|
156
|
+
res.setTimeout(Number(betweenBytesTimeout / 1_000_000n));
|
|
154
157
|
});
|
|
155
158
|
const bodyStreamId = createReadableStream(res);
|
|
156
159
|
return {
|
|
157
160
|
status: res.statusCode,
|
|
158
161
|
headers: Array.from(Object.entries(res.headers)),
|
|
159
|
-
bodyStreamId
|
|
162
|
+
bodyStreamId,
|
|
160
163
|
};
|
|
161
164
|
} catch (e) {
|
|
162
165
|
if (e?.tag) throw e;
|
package/lib/nodejs/clocks.js
CHANGED
|
@@ -38,7 +38,7 @@ export const wallClock = {
|
|
|
38
38
|
|
|
39
39
|
monotonicClock.resolution[symbolCabiLower] = () => resolution;
|
|
40
40
|
monotonicClock.now[symbolCabiLower] = () => hrtime.bigint;
|
|
41
|
-
wallClock.resolution[symbolCabiLower] = (memory) => {
|
|
41
|
+
wallClock.resolution[symbolCabiLower] = ({ memory }) => {
|
|
42
42
|
let buf32 = new Int32Array(memory.buffer);
|
|
43
43
|
return function now(retptr) {
|
|
44
44
|
if (memory.buffer !== buf32.buffer) buf32 = new Int32Array(memory.buffer);
|
|
@@ -49,7 +49,7 @@ wallClock.resolution[symbolCabiLower] = (memory) => {
|
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
wallClock.now[symbolCabiLower] = (memory) => {
|
|
52
|
+
wallClock.now[symbolCabiLower] = ({ memory }) => {
|
|
53
53
|
let buf32 = new Int32Array(memory.buffer);
|
|
54
54
|
let buf64 = new BigInt64Array(memory.buffer);
|
|
55
55
|
return function now(retptr) {
|
package/lib/nodejs/http.js
CHANGED
|
@@ -175,37 +175,27 @@ class ResponseOutparam {
|
|
|
175
175
|
const responseOutparamCreate = ResponseOutparam._create;
|
|
176
176
|
delete ResponseOutparam._create;
|
|
177
177
|
|
|
178
|
+
const defaultHttpTimeout = 600_000_000_000n;
|
|
179
|
+
|
|
178
180
|
class RequestOptions {
|
|
179
|
-
#connectTimeout;
|
|
180
|
-
#firstByteTimeout;
|
|
181
|
-
#betweenBytesTimeout;
|
|
182
|
-
//The WASI Duration is nanoseconds, js timers are set with Ms.
|
|
183
|
-
//We store the data as nanos, but provide TimeoutMs methods for
|
|
184
|
-
//convenience in setting timers elsewhere
|
|
181
|
+
#connectTimeout = defaultHttpTimeout;
|
|
182
|
+
#firstByteTimeout = defaultHttpTimeout;
|
|
183
|
+
#betweenBytesTimeout = defaultHttpTimeout;
|
|
185
184
|
connectTimeout() {
|
|
186
185
|
return this.#connectTimeout;
|
|
187
186
|
}
|
|
188
|
-
connectTimeoutMs() {
|
|
189
|
-
return this.#connectTimeout / 1_000_000;
|
|
190
|
-
}
|
|
191
187
|
setConnectTimeout(duration) {
|
|
192
188
|
this.#connectTimeout = duration;
|
|
193
189
|
}
|
|
194
190
|
firstByteTimeout() {
|
|
195
191
|
return this.#firstByteTimeout;
|
|
196
192
|
}
|
|
197
|
-
firstByteTimeoutMs() {
|
|
198
|
-
return this.#firstByteTimeout / 1_000_000;
|
|
199
|
-
}
|
|
200
193
|
setFirstByteTimeout(duration) {
|
|
201
194
|
this.#firstByteTimeout = duration;
|
|
202
195
|
}
|
|
203
196
|
betweenBytesTimeout() {
|
|
204
197
|
return this.#betweenBytesTimeout;
|
|
205
198
|
}
|
|
206
|
-
betweenBytesTimeoutMs() {
|
|
207
|
-
return this.#betweenBytesTimeout / 1_000_000;
|
|
208
|
-
}
|
|
209
199
|
setBetweenBytesTimeout(duration) {
|
|
210
200
|
this.#betweenBytesTimeout = duration;
|
|
211
201
|
}
|
|
@@ -284,9 +274,9 @@ class OutgoingRequest {
|
|
|
284
274
|
}
|
|
285
275
|
[symbolDispose]() {}
|
|
286
276
|
static _handle(request, options) {
|
|
287
|
-
const connectTimeout = options?.
|
|
288
|
-
const betweenBytesTimeout = options?.
|
|
289
|
-
const firstByteTimeout = options?.
|
|
277
|
+
const connectTimeout = options?.connectTimeout();
|
|
278
|
+
const betweenBytesTimeout = options?.betweenBytesTimeout();
|
|
279
|
+
const firstByteTimeout = options?.firstByteTimeout();
|
|
290
280
|
const scheme = schemeString(request.#scheme);
|
|
291
281
|
// note: host header is automatically added by Node.js
|
|
292
282
|
const headers = [];
|
|
@@ -303,7 +293,7 @@ class OutgoingRequest {
|
|
|
303
293
|
outgoingBodyOutputStreamId(request.#body),
|
|
304
294
|
connectTimeout,
|
|
305
295
|
betweenBytesTimeout,
|
|
306
|
-
firstByteTimeout
|
|
296
|
+
firstByteTimeout,
|
|
307
297
|
);
|
|
308
298
|
}
|
|
309
299
|
}
|
package/lib/nodejs/random.js
CHANGED
|
@@ -31,7 +31,7 @@ function getRandomBytes(len) {
|
|
|
31
31
|
return randomBytes(Number(len));
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
getRandomBytes[Symbol.for("cabiLower")] = ({ memory, realloc }) => {
|
|
35
35
|
let buf32 = new Uint32Array(memory.buffer);
|
|
36
36
|
return function randomBytes(len, retptr) {
|
|
37
37
|
len = Number(len);
|
package/package.json
CHANGED
|
@@ -5,5 +5,5 @@ export namespace WasiCliTerminalStderr {
|
|
|
5
5
|
*/
|
|
6
6
|
export function getTerminalStderr(): TerminalOutput | undefined;
|
|
7
7
|
}
|
|
8
|
-
import type { TerminalOutput } from '
|
|
8
|
+
import type { TerminalOutput } from './wasi-cli-terminal-output.js';
|
|
9
9
|
export { TerminalOutput };
|
|
@@ -5,5 +5,5 @@ export namespace WasiCliTerminalStdin {
|
|
|
5
5
|
*/
|
|
6
6
|
export function getTerminalStdin(): TerminalInput | undefined;
|
|
7
7
|
}
|
|
8
|
-
import type { TerminalInput } from '
|
|
8
|
+
import type { TerminalInput } from './wasi-cli-terminal-input.js';
|
|
9
9
|
export { TerminalInput };
|
|
@@ -5,5 +5,5 @@ export namespace WasiCliTerminalStdout {
|
|
|
5
5
|
*/
|
|
6
6
|
export function getTerminalStdout(): TerminalOutput | undefined;
|
|
7
7
|
}
|
|
8
|
-
import type { TerminalOutput } from '
|
|
8
|
+
import type { TerminalOutput } from './wasi-cli-terminal-output.js';
|
|
9
9
|
export { TerminalOutput };
|
|
@@ -23,7 +23,7 @@ export namespace WasiClocksMonotonicClock {
|
|
|
23
23
|
*/
|
|
24
24
|
export function subscribeDuration(when: Duration): Pollable;
|
|
25
25
|
}
|
|
26
|
-
import type { Pollable } from '
|
|
26
|
+
import type { Pollable } from './wasi-io-poll.js';
|
|
27
27
|
export { Pollable };
|
|
28
28
|
/**
|
|
29
29
|
* An instant in time, in nanoseconds. An instant is relative to an
|
|
@@ -4,5 +4,5 @@ export namespace WasiFilesystemPreopens {
|
|
|
4
4
|
*/
|
|
5
5
|
export function getDirectories(): [Descriptor, string][];
|
|
6
6
|
}
|
|
7
|
-
import type { Descriptor } from '
|
|
7
|
+
import type { Descriptor } from './wasi-filesystem-types.js';
|
|
8
8
|
export { Descriptor };
|
|
@@ -260,13 +260,13 @@ export namespace WasiFilesystemTypes {
|
|
|
260
260
|
*/
|
|
261
261
|
export function filesystemErrorCode(err: Error): ErrorCode | undefined;
|
|
262
262
|
}
|
|
263
|
-
import type { InputStream } from '
|
|
263
|
+
import type { InputStream } from './wasi-io-streams.js';
|
|
264
264
|
export { InputStream };
|
|
265
|
-
import type { OutputStream } from '
|
|
265
|
+
import type { OutputStream } from './wasi-io-streams.js';
|
|
266
266
|
export { OutputStream };
|
|
267
|
-
import type { Error } from '
|
|
267
|
+
import type { Error } from './wasi-io-streams.js';
|
|
268
268
|
export { Error };
|
|
269
|
-
import type { Datetime } from '
|
|
269
|
+
import type { Datetime } from './wasi-clocks-wall-clock.js';
|
|
270
270
|
export { Datetime };
|
|
271
271
|
/**
|
|
272
272
|
* File size or length of a region within a file.
|
|
@@ -639,6 +639,10 @@ export interface MetadataHashValue {
|
|
|
639
639
|
upper: bigint,
|
|
640
640
|
}
|
|
641
641
|
|
|
642
|
+
export class DirectoryEntryStream {
|
|
643
|
+
readDirectoryEntry(): DirectoryEntry | undefined;
|
|
644
|
+
}
|
|
645
|
+
|
|
642
646
|
export class Descriptor {
|
|
643
647
|
readViaStream(offset: Filesize): InputStream;
|
|
644
648
|
writeViaStream(offset: Filesize): OutputStream;
|
|
@@ -668,7 +672,3 @@ export class Descriptor {
|
|
|
668
672
|
metadataHash(): MetadataHashValue;
|
|
669
673
|
metadataHashAt(pathFlags: PathFlags, path: string): MetadataHashValue;
|
|
670
674
|
}
|
|
671
|
-
|
|
672
|
-
export class DirectoryEntryStream {
|
|
673
|
-
readDirectoryEntry(): DirectoryEntry | undefined;
|
|
674
|
-
}
|
|
@@ -13,7 +13,7 @@ export namespace WasiHttpIncomingHandler {
|
|
|
13
13
|
*/
|
|
14
14
|
export function handle(request: IncomingRequest, responseOut: ResponseOutparam): void;
|
|
15
15
|
}
|
|
16
|
-
import type { IncomingRequest } from '
|
|
16
|
+
import type { IncomingRequest } from './wasi-http-types.js';
|
|
17
17
|
export { IncomingRequest };
|
|
18
|
-
import type { ResponseOutparam } from '
|
|
18
|
+
import type { ResponseOutparam } from './wasi-http-types.js';
|
|
19
19
|
export { ResponseOutparam };
|
|
@@ -13,11 +13,11 @@ export namespace WasiHttpOutgoingHandler {
|
|
|
13
13
|
*/
|
|
14
14
|
export function handle(request: OutgoingRequest, options: RequestOptions | undefined): FutureIncomingResponse;
|
|
15
15
|
}
|
|
16
|
-
import type { OutgoingRequest } from '
|
|
16
|
+
import type { OutgoingRequest } from './wasi-http-types.js';
|
|
17
17
|
export { OutgoingRequest };
|
|
18
|
-
import type { RequestOptions } from '
|
|
18
|
+
import type { RequestOptions } from './wasi-http-types.js';
|
|
19
19
|
export { RequestOptions };
|
|
20
|
-
import type { FutureIncomingResponse } from '
|
|
20
|
+
import type { FutureIncomingResponse } from './wasi-http-types.js';
|
|
21
21
|
export { FutureIncomingResponse };
|
|
22
|
-
import type { ErrorCode } from '
|
|
22
|
+
import type { ErrorCode } from './wasi-http-types.js';
|
|
23
23
|
export { ErrorCode };
|
|
@@ -354,15 +354,15 @@ export namespace WasiHttpTypes {
|
|
|
354
354
|
* `output-stream` child.
|
|
355
355
|
*/
|
|
356
356
|
}
|
|
357
|
-
import type { Duration } from '
|
|
357
|
+
import type { Duration } from './wasi-clocks-monotonic-clock.js';
|
|
358
358
|
export { Duration };
|
|
359
|
-
import type { InputStream } from '
|
|
359
|
+
import type { InputStream } from './wasi-io-streams.js';
|
|
360
360
|
export { InputStream };
|
|
361
|
-
import type { OutputStream } from '
|
|
361
|
+
import type { OutputStream } from './wasi-io-streams.js';
|
|
362
362
|
export { OutputStream };
|
|
363
|
-
import type { Error as IoError } from '
|
|
363
|
+
import type { Error as IoError } from './wasi-io-error.js';
|
|
364
364
|
export { IoError };
|
|
365
|
-
import type { Pollable } from '
|
|
365
|
+
import type { Pollable } from './wasi-io-poll.js';
|
|
366
366
|
export { Pollable };
|
|
367
367
|
/**
|
|
368
368
|
* This type corresponds to HTTP standard Methods.
|
|
@@ -629,10 +629,6 @@ export type Trailers = Fields;
|
|
|
629
629
|
export type StatusCode = number;
|
|
630
630
|
export type Result<T, E> = { tag: 'ok', val: T } | { tag: 'err', val: E };
|
|
631
631
|
|
|
632
|
-
export class ResponseOutparam {
|
|
633
|
-
static set(param: ResponseOutparam, response: Result<OutgoingResponse, ErrorCode>): void;
|
|
634
|
-
}
|
|
635
|
-
|
|
636
632
|
export class OutgoingResponse {
|
|
637
633
|
constructor(headers: Headers)
|
|
638
634
|
statusCode(): StatusCode;
|
|
@@ -646,42 +642,22 @@ export class OutgoingBody {
|
|
|
646
642
|
static finish(this_: OutgoingBody, trailers: Trailers | undefined): void;
|
|
647
643
|
}
|
|
648
644
|
|
|
649
|
-
export class
|
|
650
|
-
|
|
651
|
-
static fromList(entries: [FieldKey, FieldValue][]): Fields;
|
|
652
|
-
get(name: FieldKey): FieldValue[];
|
|
653
|
-
has(name: FieldKey): boolean;
|
|
654
|
-
set(name: FieldKey, value: FieldValue[]): void;
|
|
655
|
-
'delete'(name: FieldKey): void;
|
|
656
|
-
append(name: FieldKey, value: FieldValue): void;
|
|
657
|
-
entries(): [FieldKey, FieldValue][];
|
|
658
|
-
clone(): Fields;
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
export class IncomingBody {
|
|
662
|
-
stream(): InputStream;
|
|
663
|
-
static finish(this_: IncomingBody): FutureTrailers;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
export class FutureIncomingResponse {
|
|
667
|
-
subscribe(): Pollable;
|
|
668
|
-
get(): Result<Result<IncomingResponse, ErrorCode>, void> | undefined;
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
export class FutureTrailers {
|
|
672
|
-
subscribe(): Pollable;
|
|
673
|
-
get(): Result<Result<Trailers | undefined, ErrorCode>, void> | undefined;
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
export class IncomingRequest {
|
|
677
|
-
method(): Method;
|
|
678
|
-
pathWithQuery(): string | undefined;
|
|
679
|
-
scheme(): Scheme | undefined;
|
|
680
|
-
authority(): string | undefined;
|
|
645
|
+
export class IncomingResponse {
|
|
646
|
+
status(): StatusCode;
|
|
681
647
|
headers(): Headers;
|
|
682
648
|
consume(): IncomingBody;
|
|
683
649
|
}
|
|
684
650
|
|
|
651
|
+
export class RequestOptions {
|
|
652
|
+
constructor()
|
|
653
|
+
connectTimeout(): Duration | undefined;
|
|
654
|
+
setConnectTimeout(duration: Duration | undefined): void;
|
|
655
|
+
firstByteTimeout(): Duration | undefined;
|
|
656
|
+
setFirstByteTimeout(duration: Duration | undefined): void;
|
|
657
|
+
betweenBytesTimeout(): Duration | undefined;
|
|
658
|
+
setBetweenBytesTimeout(duration: Duration | undefined): void;
|
|
659
|
+
}
|
|
660
|
+
|
|
685
661
|
export class OutgoingRequest {
|
|
686
662
|
constructor(headers: Headers)
|
|
687
663
|
body(): OutgoingBody;
|
|
@@ -696,18 +672,42 @@ export class OutgoingRequest {
|
|
|
696
672
|
headers(): Headers;
|
|
697
673
|
}
|
|
698
674
|
|
|
699
|
-
export class
|
|
700
|
-
|
|
675
|
+
export class IncomingRequest {
|
|
676
|
+
method(): Method;
|
|
677
|
+
pathWithQuery(): string | undefined;
|
|
678
|
+
scheme(): Scheme | undefined;
|
|
679
|
+
authority(): string | undefined;
|
|
701
680
|
headers(): Headers;
|
|
702
681
|
consume(): IncomingBody;
|
|
703
682
|
}
|
|
704
683
|
|
|
705
|
-
export class
|
|
684
|
+
export class Fields {
|
|
706
685
|
constructor()
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
686
|
+
static fromList(entries: [FieldKey, FieldValue][]): Fields;
|
|
687
|
+
get(name: FieldKey): FieldValue[];
|
|
688
|
+
has(name: FieldKey): boolean;
|
|
689
|
+
set(name: FieldKey, value: FieldValue[]): void;
|
|
690
|
+
'delete'(name: FieldKey): void;
|
|
691
|
+
append(name: FieldKey, value: FieldValue): void;
|
|
692
|
+
entries(): [FieldKey, FieldValue][];
|
|
693
|
+
clone(): Fields;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
export class FutureTrailers {
|
|
697
|
+
subscribe(): Pollable;
|
|
698
|
+
get(): Result<Result<Trailers | undefined, ErrorCode>, void> | undefined;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
export class FutureIncomingResponse {
|
|
702
|
+
subscribe(): Pollable;
|
|
703
|
+
get(): Result<Result<IncomingResponse, ErrorCode>, void> | undefined;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
export class IncomingBody {
|
|
707
|
+
stream(): InputStream;
|
|
708
|
+
static finish(this_: IncomingBody): FutureTrailers;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
export class ResponseOutparam {
|
|
712
|
+
static set(param: ResponseOutparam, response: Result<OutgoingResponse, ErrorCode>): void;
|
|
713
713
|
}
|
|
@@ -188,9 +188,9 @@ export namespace WasiIoStreams {
|
|
|
188
188
|
* is ready for reading, before performing the `splice`.
|
|
189
189
|
*/
|
|
190
190
|
}
|
|
191
|
-
import type { Error } from '
|
|
191
|
+
import type { Error } from './wasi-io-error.js';
|
|
192
192
|
export { Error };
|
|
193
|
-
import type { Pollable } from '
|
|
193
|
+
import type { Pollable } from './wasi-io-poll.js';
|
|
194
194
|
export { Pollable };
|
|
195
195
|
/**
|
|
196
196
|
* An error for input-stream and output-stream operations.
|
|
@@ -45,13 +45,13 @@ export namespace WasiSocketsIpNameLookup {
|
|
|
45
45
|
* It's planned to be removed when `future` is natively supported in Preview3.
|
|
46
46
|
*/
|
|
47
47
|
}
|
|
48
|
-
import type { Pollable } from '
|
|
48
|
+
import type { Pollable } from './wasi-io-poll.js';
|
|
49
49
|
export { Pollable };
|
|
50
|
-
import type { Network } from '
|
|
50
|
+
import type { Network } from './wasi-sockets-network.js';
|
|
51
51
|
export { Network };
|
|
52
|
-
import type { ErrorCode } from '
|
|
52
|
+
import type { ErrorCode } from './wasi-sockets-network.js';
|
|
53
53
|
export { ErrorCode };
|
|
54
|
-
import type { IpAddress } from '
|
|
54
|
+
import type { IpAddress } from './wasi-sockets-network.js';
|
|
55
55
|
export { IpAddress };
|
|
56
56
|
|
|
57
57
|
export class ResolveAddressStream {
|
|
@@ -23,11 +23,11 @@ export namespace WasiSocketsTcpCreateSocket {
|
|
|
23
23
|
*/
|
|
24
24
|
export function createTcpSocket(addressFamily: IpAddressFamily): TcpSocket;
|
|
25
25
|
}
|
|
26
|
-
import type { Network } from '
|
|
26
|
+
import type { Network } from './wasi-sockets-network.js';
|
|
27
27
|
export { Network };
|
|
28
|
-
import type { ErrorCode } from '
|
|
28
|
+
import type { ErrorCode } from './wasi-sockets-network.js';
|
|
29
29
|
export { ErrorCode };
|
|
30
|
-
import type { IpAddressFamily } from '
|
|
30
|
+
import type { IpAddressFamily } from './wasi-sockets-network.js';
|
|
31
31
|
export { IpAddressFamily };
|
|
32
|
-
import type { TcpSocket } from '
|
|
32
|
+
import type { TcpSocket } from './wasi-sockets-tcp.js';
|
|
33
33
|
export { TcpSocket };
|
|
@@ -302,21 +302,21 @@ export namespace WasiSocketsTcp {
|
|
|
302
302
|
* - <https://man.freebsd.org/cgi/man.cgi?query=shutdown&sektion=2>
|
|
303
303
|
*/
|
|
304
304
|
}
|
|
305
|
-
import type { InputStream } from '
|
|
305
|
+
import type { InputStream } from './wasi-io-streams.js';
|
|
306
306
|
export { InputStream };
|
|
307
|
-
import type { OutputStream } from '
|
|
307
|
+
import type { OutputStream } from './wasi-io-streams.js';
|
|
308
308
|
export { OutputStream };
|
|
309
|
-
import type { Pollable } from '
|
|
309
|
+
import type { Pollable } from './wasi-io-poll.js';
|
|
310
310
|
export { Pollable };
|
|
311
|
-
import type { Duration } from '
|
|
311
|
+
import type { Duration } from './wasi-clocks-monotonic-clock.js';
|
|
312
312
|
export { Duration };
|
|
313
|
-
import type { Network } from '
|
|
313
|
+
import type { Network } from './wasi-sockets-network.js';
|
|
314
314
|
export { Network };
|
|
315
|
-
import type { ErrorCode } from '
|
|
315
|
+
import type { ErrorCode } from './wasi-sockets-network.js';
|
|
316
316
|
export { ErrorCode };
|
|
317
|
-
import type { IpSocketAddress } from '
|
|
317
|
+
import type { IpSocketAddress } from './wasi-sockets-network.js';
|
|
318
318
|
export { IpSocketAddress };
|
|
319
|
-
import type { IpAddressFamily } from '
|
|
319
|
+
import type { IpAddressFamily } from './wasi-sockets-network.js';
|
|
320
320
|
export { IpAddressFamily };
|
|
321
321
|
/**
|
|
322
322
|
* # Variants
|
|
@@ -23,11 +23,11 @@ export namespace WasiSocketsUdpCreateSocket {
|
|
|
23
23
|
*/
|
|
24
24
|
export function createUdpSocket(addressFamily: IpAddressFamily): UdpSocket;
|
|
25
25
|
}
|
|
26
|
-
import type { Network } from '
|
|
26
|
+
import type { Network } from './wasi-sockets-network.js';
|
|
27
27
|
export { Network };
|
|
28
|
-
import type { ErrorCode } from '
|
|
28
|
+
import type { ErrorCode } from './wasi-sockets-network.js';
|
|
29
29
|
export { ErrorCode };
|
|
30
|
-
import type { IpAddressFamily } from '
|
|
30
|
+
import type { IpAddressFamily } from './wasi-sockets-network.js';
|
|
31
31
|
export { IpAddressFamily };
|
|
32
|
-
import type { UdpSocket } from '
|
|
32
|
+
import type { UdpSocket } from './wasi-sockets-udp.js';
|
|
33
33
|
export { UdpSocket };
|
|
@@ -220,15 +220,15 @@ export namespace WasiSocketsUdp {
|
|
|
220
220
|
* It's planned to be removed when `future` is natively supported in Preview3.
|
|
221
221
|
*/
|
|
222
222
|
}
|
|
223
|
-
import type { Pollable } from '
|
|
223
|
+
import type { Pollable } from './wasi-io-poll.js';
|
|
224
224
|
export { Pollable };
|
|
225
|
-
import type { Network } from '
|
|
225
|
+
import type { Network } from './wasi-sockets-network.js';
|
|
226
226
|
export { Network };
|
|
227
|
-
import type { ErrorCode } from '
|
|
227
|
+
import type { ErrorCode } from './wasi-sockets-network.js';
|
|
228
228
|
export { ErrorCode };
|
|
229
|
-
import type { IpSocketAddress } from '
|
|
229
|
+
import type { IpSocketAddress } from './wasi-sockets-network.js';
|
|
230
230
|
export { IpSocketAddress };
|
|
231
|
-
import type { IpAddressFamily } from '
|
|
231
|
+
import type { IpAddressFamily } from './wasi-sockets-network.js';
|
|
232
232
|
export { IpAddressFamily };
|
|
233
233
|
/**
|
|
234
234
|
* A received datagram.
|