@bytecodealliance/preview2-shim 0.17.1 → 0.17.3
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/browser/cli.js +91 -94
- package/lib/browser/clocks.js +30 -29
- package/lib/browser/filesystem.js +298 -251
- package/lib/browser/http.js +129 -128
- package/lib/browser/index.js +8 -16
- package/lib/browser/io.js +143 -135
- package/lib/browser/random.js +44 -42
- package/lib/browser/sockets.js +68 -166
- package/lib/common/instantiation.js +127 -0
- package/lib/io/calls.js +7 -5
- package/lib/io/worker-http.js +175 -157
- package/lib/io/worker-io.js +402 -386
- package/lib/io/worker-socket-tcp.js +271 -219
- package/lib/io/worker-socket-udp.js +494 -429
- package/lib/io/worker-sockets.js +276 -262
- package/lib/io/worker-thread.js +946 -815
- package/lib/nodejs/cli.js +64 -63
- package/lib/nodejs/clocks.js +51 -45
- package/lib/nodejs/filesystem.js +788 -654
- package/lib/nodejs/http.js +693 -617
- package/lib/nodejs/index.js +8 -16
- package/lib/nodejs/random.js +32 -28
- package/lib/nodejs/sockets.js +538 -474
- package/lib/synckit/index.js +94 -85
- package/package.json +9 -5
- package/types/cli.d.ts +11 -23
- package/types/clocks.d.ts +2 -5
- package/types/filesystem.d.ts +2 -5
- package/types/http.d.ts +3 -7
- package/types/index.d.ts +6 -15
- package/types/instantiation.d.ts +112 -0
- package/types/interfaces/wasi-cli-environment.d.ts +21 -22
- package/types/interfaces/wasi-cli-exit.d.ts +5 -6
- package/types/interfaces/wasi-cli-run.d.ts +5 -6
- package/types/interfaces/wasi-cli-stderr.d.ts +3 -5
- package/types/interfaces/wasi-cli-stdin.d.ts +3 -5
- package/types/interfaces/wasi-cli-stdout.d.ts +3 -5
- package/types/interfaces/wasi-cli-terminal-input.d.ts +5 -3
- package/types/interfaces/wasi-cli-terminal-output.d.ts +5 -3
- package/types/interfaces/wasi-cli-terminal-stderr.d.ts +7 -9
- package/types/interfaces/wasi-cli-terminal-stdin.d.ts +7 -9
- package/types/interfaces/wasi-cli-terminal-stdout.d.ts +7 -9
- package/types/interfaces/wasi-clocks-monotonic-clock.d.ts +24 -26
- package/types/interfaces/wasi-clocks-wall-clock.d.ts +23 -24
- package/types/interfaces/wasi-filesystem-preopens.d.ts +6 -8
- package/types/interfaces/wasi-filesystem-types.d.ts +34 -33
- package/types/interfaces/wasi-http-incoming-handler.d.ts +16 -19
- package/types/interfaces/wasi-http-outgoing-handler.d.ts +18 -23
- package/types/interfaces/wasi-http-types.d.ts +49 -38
- package/types/interfaces/wasi-io-error.d.ts +5 -3
- package/types/interfaces/wasi-io-poll.d.ts +27 -25
- package/types/interfaces/wasi-io-streams.d.ts +24 -21
- package/types/interfaces/wasi-random-insecure-seed.d.ts +21 -22
- package/types/interfaces/wasi-random-insecure.d.ts +19 -20
- package/types/interfaces/wasi-random-random.d.ts +23 -24
- package/types/interfaces/wasi-sockets-instance-network.d.ts +6 -8
- package/types/interfaces/wasi-sockets-ip-name-lookup.d.ts +32 -34
- package/types/interfaces/wasi-sockets-network.d.ts +5 -3
- package/types/interfaces/wasi-sockets-tcp-create-socket.d.ts +28 -33
- package/types/interfaces/wasi-sockets-tcp.d.ts +17 -23
- package/types/interfaces/wasi-sockets-udp-create-socket.d.ts +28 -33
- package/types/interfaces/wasi-sockets-udp.d.ts +20 -17
- package/types/io.d.ts +3 -7
- package/types/random.d.ts +3 -7
- package/types/sockets.d.ts +7 -15
- package/types/wasi-cli-command.d.ts +29 -29
- package/types/wasi-http-proxy.d.ts +13 -13
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
1
|
+
/** @module Interface wasi:random/insecure@0.2.3 **/
|
|
2
|
+
/**
|
|
3
|
+
* Return `len` insecure pseudo-random bytes.
|
|
4
|
+
*
|
|
5
|
+
* This function is not cryptographically secure. Do not use it for
|
|
6
|
+
* anything related to security.
|
|
7
|
+
*
|
|
8
|
+
* There are no requirements on the values of the returned bytes, however
|
|
9
|
+
* implementations are encouraged to return evenly distributed values with
|
|
10
|
+
* a long period.
|
|
11
|
+
*/
|
|
12
|
+
export function getInsecureRandomBytes(len: bigint): Uint8Array;
|
|
13
|
+
/**
|
|
14
|
+
* Return an insecure pseudo-random `u64` value.
|
|
15
|
+
*
|
|
16
|
+
* This function returns the same type of pseudo-random data as
|
|
17
|
+
* `get-insecure-random-bytes`, represented as a `u64`.
|
|
18
|
+
*/
|
|
19
|
+
export function getInsecureRandomU64(): bigint;
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
1
|
+
/** @module Interface wasi:random/random@0.2.3 **/
|
|
2
|
+
/**
|
|
3
|
+
* Return `len` cryptographically-secure random or pseudo-random bytes.
|
|
4
|
+
*
|
|
5
|
+
* This function must produce data at least as cryptographically secure and
|
|
6
|
+
* fast as an adequately seeded cryptographically-secure pseudo-random
|
|
7
|
+
* number generator (CSPRNG). It must not block, from the perspective of
|
|
8
|
+
* the calling program, under any circumstances, including on the first
|
|
9
|
+
* request and on requests for numbers of bytes. The returned data must
|
|
10
|
+
* always be unpredictable.
|
|
11
|
+
*
|
|
12
|
+
* This function must always return fresh data. Deterministic environments
|
|
13
|
+
* must omit this function, rather than implementing it with deterministic
|
|
14
|
+
* data.
|
|
15
|
+
*/
|
|
16
|
+
export function getRandomBytes(len: bigint): Uint8Array;
|
|
17
|
+
/**
|
|
18
|
+
* Return a cryptographically-secure random or pseudo-random `u64` value.
|
|
19
|
+
*
|
|
20
|
+
* This function returns the same type of data as `get-random-bytes`,
|
|
21
|
+
* represented as a `u64`.
|
|
22
|
+
*/
|
|
23
|
+
export function getRandomU64(): bigint;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import type { Network } from './wasi-sockets-network.js';
|
|
8
|
-
export { Network };
|
|
1
|
+
/** @module Interface wasi:sockets/instance-network@0.2.3 **/
|
|
2
|
+
/**
|
|
3
|
+
* Get a handle to the default network.
|
|
4
|
+
*/
|
|
5
|
+
export function instanceNetwork(): Network;
|
|
6
|
+
export type Network = import('./wasi-sockets-network.js').Network;
|
|
@@ -1,39 +1,37 @@
|
|
|
1
|
-
|
|
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
|
-
export
|
|
29
|
-
import type { Network } from './wasi-sockets-network.js';
|
|
30
|
-
export { Network };
|
|
31
|
-
import type { ErrorCode } from './wasi-sockets-network.js';
|
|
32
|
-
export { ErrorCode };
|
|
33
|
-
import type { IpAddress } from './wasi-sockets-network.js';
|
|
34
|
-
export { IpAddress };
|
|
1
|
+
/** @module Interface wasi:sockets/ip-name-lookup@0.2.3 **/
|
|
2
|
+
/**
|
|
3
|
+
* Resolve an internet host name to a list of IP addresses.
|
|
4
|
+
*
|
|
5
|
+
* Unicode domain names are automatically converted to ASCII using IDNA encoding.
|
|
6
|
+
* If the input is an IP address string, the address is parsed and returned
|
|
7
|
+
* as-is without making any external requests.
|
|
8
|
+
*
|
|
9
|
+
* See the wasi-socket proposal README.md for a comparison with getaddrinfo.
|
|
10
|
+
*
|
|
11
|
+
* This function never blocks. It either immediately fails or immediately
|
|
12
|
+
* returns successfully with a `resolve-address-stream` that can be used
|
|
13
|
+
* to (asynchronously) fetch the results.
|
|
14
|
+
*
|
|
15
|
+
* # Typical errors
|
|
16
|
+
* - `invalid-argument`: `name` is a syntactically invalid domain name or IP address.
|
|
17
|
+
*
|
|
18
|
+
* # References:
|
|
19
|
+
* - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getaddrinfo.html>
|
|
20
|
+
* - <https://man7.org/linux/man-pages/man3/getaddrinfo.3.html>
|
|
21
|
+
* - <https://learn.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo>
|
|
22
|
+
* - <https://man.freebsd.org/cgi/man.cgi?query=getaddrinfo&sektion=3>
|
|
23
|
+
*/
|
|
24
|
+
export function resolveAddresses(network: Network, name: string): ResolveAddressStream;
|
|
25
|
+
export type Pollable = import('./wasi-io-poll.js').Pollable;
|
|
26
|
+
export type Network = import('./wasi-sockets-network.js').Network;
|
|
27
|
+
export type ErrorCode = import('./wasi-sockets-network.js').ErrorCode;
|
|
28
|
+
export type IpAddress = import('./wasi-sockets-network.js').IpAddress;
|
|
35
29
|
|
|
36
30
|
export class ResolveAddressStream {
|
|
31
|
+
/**
|
|
32
|
+
* This type does not have a public constructor.
|
|
33
|
+
*/
|
|
34
|
+
private constructor();
|
|
37
35
|
/**
|
|
38
36
|
* Returns the next address from the resolver.
|
|
39
37
|
*
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export { Network };
|
|
3
|
-
}
|
|
1
|
+
/** @module Interface wasi:sockets/network@0.2.3 **/
|
|
4
2
|
/**
|
|
5
3
|
* Error codes.
|
|
6
4
|
*
|
|
@@ -159,4 +157,8 @@ export interface IpSocketAddressIpv6 {
|
|
|
159
157
|
}
|
|
160
158
|
|
|
161
159
|
export class Network {
|
|
160
|
+
/**
|
|
161
|
+
* This type does not have a public constructor.
|
|
162
|
+
*/
|
|
163
|
+
private constructor();
|
|
162
164
|
}
|
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
|
|
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
|
-
export
|
|
28
|
-
|
|
29
|
-
export { ErrorCode };
|
|
30
|
-
import type { IpAddressFamily } from './wasi-sockets-network.js';
|
|
31
|
-
export { IpAddressFamily };
|
|
32
|
-
import type { TcpSocket } from './wasi-sockets-tcp.js';
|
|
33
|
-
export { TcpSocket };
|
|
1
|
+
/** @module Interface wasi:sockets/tcp-create-socket@0.2.3 **/
|
|
2
|
+
/**
|
|
3
|
+
* Create a new TCP socket.
|
|
4
|
+
*
|
|
5
|
+
* Similar to `socket(AF_INET or AF_INET6, SOCK_STREAM, IPPROTO_TCP)` in POSIX.
|
|
6
|
+
* On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise.
|
|
7
|
+
*
|
|
8
|
+
* This function does not require a network capability handle. This is considered to be safe because
|
|
9
|
+
* at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind`/`connect`
|
|
10
|
+
* is called, the socket is effectively an in-memory configuration object, unable to communicate with the outside world.
|
|
11
|
+
*
|
|
12
|
+
* All sockets are non-blocking. Use the wasi-poll interface to block on asynchronous operations.
|
|
13
|
+
*
|
|
14
|
+
* # Typical errors
|
|
15
|
+
* - `not-supported`: The specified `address-family` is not supported. (EAFNOSUPPORT)
|
|
16
|
+
* - `new-socket-limit`: The new socket resource could not be created because of a system limit. (EMFILE, ENFILE)
|
|
17
|
+
*
|
|
18
|
+
* # References
|
|
19
|
+
* - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html>
|
|
20
|
+
* - <https://man7.org/linux/man-pages/man2/socket.2.html>
|
|
21
|
+
* - <https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketw>
|
|
22
|
+
* - <https://man.freebsd.org/cgi/man.cgi?query=socket&sektion=2>
|
|
23
|
+
*/
|
|
24
|
+
export function createTcpSocket(addressFamily: IpAddressFamily): TcpSocket;
|
|
25
|
+
export type Network = import('./wasi-sockets-network.js').Network;
|
|
26
|
+
export type ErrorCode = import('./wasi-sockets-network.js').ErrorCode;
|
|
27
|
+
export type IpAddressFamily = import('./wasi-sockets-network.js').IpAddressFamily;
|
|
28
|
+
export type TcpSocket = import('./wasi-sockets-tcp.js').TcpSocket;
|
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
import type { Duration } from './wasi-clocks-monotonic-clock.js';
|
|
11
|
-
export { Duration };
|
|
12
|
-
import type { Network } from './wasi-sockets-network.js';
|
|
13
|
-
export { Network };
|
|
14
|
-
import type { ErrorCode } from './wasi-sockets-network.js';
|
|
15
|
-
export { ErrorCode };
|
|
16
|
-
import type { IpSocketAddress } from './wasi-sockets-network.js';
|
|
17
|
-
export { IpSocketAddress };
|
|
18
|
-
import type { IpAddressFamily } from './wasi-sockets-network.js';
|
|
19
|
-
export { IpAddressFamily };
|
|
1
|
+
/** @module Interface wasi:sockets/tcp@0.2.3 **/
|
|
2
|
+
export type InputStream = import('./wasi-io-streams.js').InputStream;
|
|
3
|
+
export type OutputStream = import('./wasi-io-streams.js').OutputStream;
|
|
4
|
+
export type Pollable = import('./wasi-io-poll.js').Pollable;
|
|
5
|
+
export type Duration = import('./wasi-clocks-monotonic-clock.js').Duration;
|
|
6
|
+
export type Network = import('./wasi-sockets-network.js').Network;
|
|
7
|
+
export type ErrorCode = import('./wasi-sockets-network.js').ErrorCode;
|
|
8
|
+
export type IpSocketAddress = import('./wasi-sockets-network.js').IpSocketAddress;
|
|
9
|
+
export type IpAddressFamily = import('./wasi-sockets-network.js').IpAddressFamily;
|
|
20
10
|
/**
|
|
21
11
|
* # Variants
|
|
22
12
|
*
|
|
@@ -33,6 +23,10 @@ export { IpAddressFamily };
|
|
|
33
23
|
export type ShutdownType = 'receive' | 'send' | 'both';
|
|
34
24
|
|
|
35
25
|
export class TcpSocket {
|
|
26
|
+
/**
|
|
27
|
+
* This type does not have a public constructor.
|
|
28
|
+
*/
|
|
29
|
+
private constructor();
|
|
36
30
|
/**
|
|
37
31
|
* Bind the socket to a specific network on the provided IP address and port.
|
|
38
32
|
*
|
|
@@ -340,11 +334,11 @@ export class TcpSocket {
|
|
|
340
334
|
* Initiate a graceful shutdown.
|
|
341
335
|
*
|
|
342
336
|
* - `receive`: The socket is not expecting to receive any data from
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
337
|
+
* the peer. The `input-stream` associated with this socket will be
|
|
338
|
+
* closed. Any data still in the receive queue at time of calling
|
|
339
|
+
* this method will be discarded.
|
|
346
340
|
* - `send`: The socket has no more data to send to the peer. The `output-stream`
|
|
347
|
-
*
|
|
341
|
+
* associated with this socket will be closed and a FIN packet will be sent.
|
|
348
342
|
* - `both`: Same effect as `receive` & `send` combined.
|
|
349
343
|
*
|
|
350
344
|
* This function is idempotent; shutting down a direction more than once
|
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
|
|
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
|
-
export
|
|
28
|
-
|
|
29
|
-
export { ErrorCode };
|
|
30
|
-
import type { IpAddressFamily } from './wasi-sockets-network.js';
|
|
31
|
-
export { IpAddressFamily };
|
|
32
|
-
import type { UdpSocket } from './wasi-sockets-udp.js';
|
|
33
|
-
export { UdpSocket };
|
|
1
|
+
/** @module Interface wasi:sockets/udp-create-socket@0.2.3 **/
|
|
2
|
+
/**
|
|
3
|
+
* Create a new UDP socket.
|
|
4
|
+
*
|
|
5
|
+
* Similar to `socket(AF_INET or AF_INET6, SOCK_DGRAM, IPPROTO_UDP)` in POSIX.
|
|
6
|
+
* On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise.
|
|
7
|
+
*
|
|
8
|
+
* This function does not require a network capability handle. This is considered to be safe because
|
|
9
|
+
* at time of creation, the socket is not bound to any `network` yet. Up to the moment `bind` is called,
|
|
10
|
+
* the socket is effectively an in-memory configuration object, unable to communicate with the outside world.
|
|
11
|
+
*
|
|
12
|
+
* All sockets are non-blocking. Use the wasi-poll interface to block on asynchronous operations.
|
|
13
|
+
*
|
|
14
|
+
* # Typical errors
|
|
15
|
+
* - `not-supported`: The specified `address-family` is not supported. (EAFNOSUPPORT)
|
|
16
|
+
* - `new-socket-limit`: The new socket resource could not be created because of a system limit. (EMFILE, ENFILE)
|
|
17
|
+
*
|
|
18
|
+
* # References:
|
|
19
|
+
* - <https://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html>
|
|
20
|
+
* - <https://man7.org/linux/man-pages/man2/socket.2.html>
|
|
21
|
+
* - <https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketw>
|
|
22
|
+
* - <https://man.freebsd.org/cgi/man.cgi?query=socket&sektion=2>
|
|
23
|
+
*/
|
|
24
|
+
export function createUdpSocket(addressFamily: IpAddressFamily): UdpSocket;
|
|
25
|
+
export type Network = import('./wasi-sockets-network.js').Network;
|
|
26
|
+
export type ErrorCode = import('./wasi-sockets-network.js').ErrorCode;
|
|
27
|
+
export type IpAddressFamily = import('./wasi-sockets-network.js').IpAddressFamily;
|
|
28
|
+
export type UdpSocket = import('./wasi-sockets-udp.js').UdpSocket;
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { Pollable };
|
|
8
|
-
import type { Network } from './wasi-sockets-network.js';
|
|
9
|
-
export { Network };
|
|
10
|
-
import type { ErrorCode } from './wasi-sockets-network.js';
|
|
11
|
-
export { ErrorCode };
|
|
12
|
-
import type { IpSocketAddress } from './wasi-sockets-network.js';
|
|
13
|
-
export { IpSocketAddress };
|
|
14
|
-
import type { IpAddressFamily } from './wasi-sockets-network.js';
|
|
15
|
-
export { IpAddressFamily };
|
|
1
|
+
/** @module Interface wasi:sockets/udp@0.2.3 **/
|
|
2
|
+
export type Pollable = import('./wasi-io-poll.js').Pollable;
|
|
3
|
+
export type Network = import('./wasi-sockets-network.js').Network;
|
|
4
|
+
export type ErrorCode = import('./wasi-sockets-network.js').ErrorCode;
|
|
5
|
+
export type IpSocketAddress = import('./wasi-sockets-network.js').IpSocketAddress;
|
|
6
|
+
export type IpAddressFamily = import('./wasi-sockets-network.js').IpAddressFamily;
|
|
16
7
|
/**
|
|
17
8
|
* A received datagram.
|
|
18
9
|
*/
|
|
@@ -53,6 +44,10 @@ export interface OutgoingDatagram {
|
|
|
53
44
|
}
|
|
54
45
|
|
|
55
46
|
export class IncomingDatagramStream {
|
|
47
|
+
/**
|
|
48
|
+
* This type does not have a public constructor.
|
|
49
|
+
*/
|
|
50
|
+
private constructor();
|
|
56
51
|
/**
|
|
57
52
|
* Receive messages on the socket.
|
|
58
53
|
*
|
|
@@ -89,6 +84,10 @@ export class IncomingDatagramStream {
|
|
|
89
84
|
}
|
|
90
85
|
|
|
91
86
|
export class OutgoingDatagramStream {
|
|
87
|
+
/**
|
|
88
|
+
* This type does not have a public constructor.
|
|
89
|
+
*/
|
|
90
|
+
private constructor();
|
|
92
91
|
/**
|
|
93
92
|
* Check readiness for sending. This function never blocks.
|
|
94
93
|
*
|
|
@@ -150,6 +149,10 @@ export class OutgoingDatagramStream {
|
|
|
150
149
|
}
|
|
151
150
|
|
|
152
151
|
export class UdpSocket {
|
|
152
|
+
/**
|
|
153
|
+
* This type does not have a public constructor.
|
|
154
|
+
*/
|
|
155
|
+
private constructor();
|
|
153
156
|
/**
|
|
154
157
|
* Bind the socket to a specific network on the provided IP address and port.
|
|
155
158
|
*
|
|
@@ -198,10 +201,10 @@ export class UdpSocket {
|
|
|
198
201
|
* The POSIX equivalent in pseudo-code is:
|
|
199
202
|
* ```text
|
|
200
203
|
* if (was previously connected) {
|
|
201
|
-
*
|
|
204
|
+
* connect(s, AF_UNSPEC)
|
|
202
205
|
* }
|
|
203
206
|
* if (remote_address is Some) {
|
|
204
|
-
*
|
|
207
|
+
* connect(s, remote_address)
|
|
205
208
|
* }
|
|
206
209
|
* ```
|
|
207
210
|
*
|
package/types/io.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const error: typeof WasiIoError;
|
|
6
|
-
export const poll: typeof WasiIoPoll;
|
|
7
|
-
export const streams: typeof WasiIoStreams;
|
|
1
|
+
export type * as error from './interfaces/wasi-io-error.d.ts';
|
|
2
|
+
export type * as poll from './interfaces/wasi-io-poll.d.ts';
|
|
3
|
+
export type * as streams from './interfaces/wasi-io-streams.d.ts';
|
package/types/random.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const insecureSeed: typeof WasiRandomInsecureSeed;
|
|
6
|
-
export const insecure: typeof WasiRandomInsecure;
|
|
7
|
-
export const random: typeof WasiRandomRandom;
|
|
1
|
+
export type * as insecureSeed from './interfaces/wasi-random-insecure-seed.d.ts';
|
|
2
|
+
export type * as insecure from './interfaces/wasi-random-insecure.d.ts';
|
|
3
|
+
export type * as random from './interfaces/wasi-random-random.d.ts';
|
package/types/sockets.d.ts
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export const instanceNetwork: typeof WasiSocketsInstanceNetwork;
|
|
10
|
-
export const ipNameLookup: typeof WasiSocketsIpNameLookup;
|
|
11
|
-
export const network: typeof WasiSocketsNetwork;
|
|
12
|
-
export const tcpCreateSocket: typeof WasiSocketsTcpCreateSocket;
|
|
13
|
-
export const tcp: typeof WasiSocketsTcp;
|
|
14
|
-
export const udpCreateSocket: typeof WasiSocketsUdpCreateSocket;
|
|
15
|
-
export const udp: typeof WasiSocketsUdp;
|
|
1
|
+
export type * as instanceNetwork from './interfaces/wasi-sockets-instance-network.d.ts';
|
|
2
|
+
export type * as ipNameLookup from './interfaces/wasi-sockets-ip-name-lookup.d.ts';
|
|
3
|
+
export type * as network from './interfaces/wasi-sockets-network.d.ts';
|
|
4
|
+
export type * as tcpCreateSocket from './interfaces/wasi-sockets-tcp-create-socket.d.ts';
|
|
5
|
+
export type * as tcp from './interfaces/wasi-sockets-tcp.d.ts';
|
|
6
|
+
export type * as udpCreateSocket from './interfaces/wasi-sockets-udp-create-socket.d.ts';
|
|
7
|
+
export type * as udp from './interfaces/wasi-sockets-udp.d.ts';
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
|
|
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
|
-
export
|
|
1
|
+
// world wasi:cli/command@0.2.3
|
|
2
|
+
export type * as WasiCliEnvironment023 from './interfaces/wasi-cli-environment.js'; // import wasi:cli/environment@0.2.3
|
|
3
|
+
export type * as WasiCliExit023 from './interfaces/wasi-cli-exit.js'; // import wasi:cli/exit@0.2.3
|
|
4
|
+
export type * as WasiCliStderr023 from './interfaces/wasi-cli-stderr.js'; // import wasi:cli/stderr@0.2.3
|
|
5
|
+
export type * as WasiCliStdin023 from './interfaces/wasi-cli-stdin.js'; // import wasi:cli/stdin@0.2.3
|
|
6
|
+
export type * as WasiCliStdout023 from './interfaces/wasi-cli-stdout.js'; // import wasi:cli/stdout@0.2.3
|
|
7
|
+
export type * as WasiCliTerminalInput023 from './interfaces/wasi-cli-terminal-input.js'; // import wasi:cli/terminal-input@0.2.3
|
|
8
|
+
export type * as WasiCliTerminalOutput023 from './interfaces/wasi-cli-terminal-output.js'; // import wasi:cli/terminal-output@0.2.3
|
|
9
|
+
export type * as WasiCliTerminalStderr023 from './interfaces/wasi-cli-terminal-stderr.js'; // import wasi:cli/terminal-stderr@0.2.3
|
|
10
|
+
export type * as WasiCliTerminalStdin023 from './interfaces/wasi-cli-terminal-stdin.js'; // import wasi:cli/terminal-stdin@0.2.3
|
|
11
|
+
export type * as WasiCliTerminalStdout023 from './interfaces/wasi-cli-terminal-stdout.js'; // import wasi:cli/terminal-stdout@0.2.3
|
|
12
|
+
export type * as WasiClocksMonotonicClock023 from './interfaces/wasi-clocks-monotonic-clock.js'; // import wasi:clocks/monotonic-clock@0.2.3
|
|
13
|
+
export type * as WasiClocksWallClock023 from './interfaces/wasi-clocks-wall-clock.js'; // import wasi:clocks/wall-clock@0.2.3
|
|
14
|
+
export type * as WasiFilesystemPreopens023 from './interfaces/wasi-filesystem-preopens.js'; // import wasi:filesystem/preopens@0.2.3
|
|
15
|
+
export type * as WasiFilesystemTypes023 from './interfaces/wasi-filesystem-types.js'; // import wasi:filesystem/types@0.2.3
|
|
16
|
+
export type * as WasiIoError023 from './interfaces/wasi-io-error.js'; // import wasi:io/error@0.2.3
|
|
17
|
+
export type * as WasiIoPoll023 from './interfaces/wasi-io-poll.js'; // import wasi:io/poll@0.2.3
|
|
18
|
+
export type * as WasiIoStreams023 from './interfaces/wasi-io-streams.js'; // import wasi:io/streams@0.2.3
|
|
19
|
+
export type * as WasiRandomInsecureSeed023 from './interfaces/wasi-random-insecure-seed.js'; // import wasi:random/insecure-seed@0.2.3
|
|
20
|
+
export type * as WasiRandomInsecure023 from './interfaces/wasi-random-insecure.js'; // import wasi:random/insecure@0.2.3
|
|
21
|
+
export type * as WasiRandomRandom023 from './interfaces/wasi-random-random.js'; // import wasi:random/random@0.2.3
|
|
22
|
+
export type * as WasiSocketsInstanceNetwork023 from './interfaces/wasi-sockets-instance-network.js'; // import wasi:sockets/instance-network@0.2.3
|
|
23
|
+
export type * as WasiSocketsIpNameLookup023 from './interfaces/wasi-sockets-ip-name-lookup.js'; // import wasi:sockets/ip-name-lookup@0.2.3
|
|
24
|
+
export type * as WasiSocketsNetwork023 from './interfaces/wasi-sockets-network.js'; // import wasi:sockets/network@0.2.3
|
|
25
|
+
export type * as WasiSocketsTcpCreateSocket023 from './interfaces/wasi-sockets-tcp-create-socket.js'; // import wasi:sockets/tcp-create-socket@0.2.3
|
|
26
|
+
export type * as WasiSocketsTcp023 from './interfaces/wasi-sockets-tcp.js'; // import wasi:sockets/tcp@0.2.3
|
|
27
|
+
export type * as WasiSocketsUdpCreateSocket023 from './interfaces/wasi-sockets-udp-create-socket.js'; // import wasi:sockets/udp-create-socket@0.2.3
|
|
28
|
+
export type * as WasiSocketsUdp023 from './interfaces/wasi-sockets-udp.js'; // import wasi:sockets/udp@0.2.3
|
|
29
|
+
export * as run from './interfaces/wasi-cli-run.js'; // export wasi:cli/run@0.2.3
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export
|
|
1
|
+
// world wasi:http/proxy@0.2.3
|
|
2
|
+
export type * as WasiCliStderr023 from './interfaces/wasi-cli-stderr.js'; // import wasi:cli/stderr@0.2.3
|
|
3
|
+
export type * as WasiCliStdin023 from './interfaces/wasi-cli-stdin.js'; // import wasi:cli/stdin@0.2.3
|
|
4
|
+
export type * as WasiCliStdout023 from './interfaces/wasi-cli-stdout.js'; // import wasi:cli/stdout@0.2.3
|
|
5
|
+
export type * as WasiClocksMonotonicClock023 from './interfaces/wasi-clocks-monotonic-clock.js'; // import wasi:clocks/monotonic-clock@0.2.3
|
|
6
|
+
export type * as WasiClocksWallClock023 from './interfaces/wasi-clocks-wall-clock.js'; // import wasi:clocks/wall-clock@0.2.3
|
|
7
|
+
export type * as WasiHttpOutgoingHandler023 from './interfaces/wasi-http-outgoing-handler.js'; // import wasi:http/outgoing-handler@0.2.3
|
|
8
|
+
export type * as WasiHttpTypes023 from './interfaces/wasi-http-types.js'; // import wasi:http/types@0.2.3
|
|
9
|
+
export type * as WasiIoError023 from './interfaces/wasi-io-error.js'; // import wasi:io/error@0.2.3
|
|
10
|
+
export type * as WasiIoPoll023 from './interfaces/wasi-io-poll.js'; // import wasi:io/poll@0.2.3
|
|
11
|
+
export type * as WasiIoStreams023 from './interfaces/wasi-io-streams.js'; // import wasi:io/streams@0.2.3
|
|
12
|
+
export type * as WasiRandomRandom023 from './interfaces/wasi-random-random.js'; // import wasi:random/random@0.2.3
|
|
13
|
+
export * as incomingHandler from './interfaces/wasi-http-incoming-handler.js'; // export wasi:http/incoming-handler@0.2.3
|