@wasi-gfx/js-webgpu 0.2.0 → 0.3.0
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 +3 -3
- package/dist/canvas.d.ts +3 -3
- package/dist/canvas.js +36 -23
- package/dist/webgpu.d.ts +39 -12
- package/dist/webgpu.js +248 -42
- package/package.json +12 -6
- package/types/interfaces/wasi-cli-run.d.ts +2 -2
- package/types/interfaces/wasi-cli-stdout.d.ts +14 -3
- package/types/interfaces/wasi-cli-types.d.ts +15 -0
- package/types/interfaces/wasi-gfx-frame-buffer-frame-buffer.d.ts +13 -0
- package/types/interfaces/wasi-gfx-surface-surface-frame-buffer.d.ts +12 -0
- package/types/interfaces/wasi-gfx-surface-surface-webgpu.d.ts +29 -0
- package/types/interfaces/{wasi-surface-surface.d.ts → wasi-gfx-surface-surface.d.ts} +8 -18
- package/types/interfaces/wasi-webgpu-webgpu.d.ts +809 -810
- package/types/wit.d.ts +9 -10
- package/wit/deps/wasi-cli-0.3.0/package.wit +256 -0
- package/wit/deps/wasi-clocks-0.3.0/package.wit +43 -0
- package/wit/deps/wasi-filesystem-0.3.0/package.wit +149 -0
- package/wit/deps/wasi-gfx-frame-buffer-0.2.0/package.wit +13 -0
- package/wit/deps/{surface/surface.wit → wasi-gfx-surface-0.2.0/package.wit} +69 -44
- package/wit/deps/wasi-random-0.3.0/package.wit +18 -0
- package/wit/deps/wasi-sockets-0.3.0/package.wit +116 -0
- package/wit/deps/{webgpu/webgpu.wit → wasi-webgpu-0.3.0-rc.2/package.wit} +1007 -836
- package/wit/world.wit +8 -7
- package/types/interfaces/wasi-frame-buffer-frame-buffer.d.ts +0 -21
- package/types/interfaces/wasi-graphics-context-graphics-context.d.ts +0 -17
- package/types/interfaces/wasi-io-error.d.ts +0 -18
- package/types/interfaces/wasi-io-poll.d.ts +0 -43
- package/types/interfaces/wasi-io-streams.d.ts +0 -240
- package/wit/deps/cli/command.wit +0 -7
- package/wit/deps/cli/environment.wit +0 -18
- package/wit/deps/cli/exit.wit +0 -4
- package/wit/deps/cli/imports.wit +0 -20
- package/wit/deps/cli/run.wit +0 -4
- package/wit/deps/cli/stdio.wit +0 -17
- package/wit/deps/cli/terminal.wit +0 -49
- package/wit/deps/clocks/monotonic-clock.wit +0 -45
- package/wit/deps/clocks/wall-clock.wit +0 -42
- package/wit/deps/clocks/world.wit +0 -6
- package/wit/deps/filesystem/preopens.wit +0 -8
- package/wit/deps/filesystem/types.wit +0 -634
- package/wit/deps/filesystem/world.wit +0 -6
- package/wit/deps/frame-buffer/frame-buffer.wit +0 -23
- package/wit/deps/graphics-context/graphics-context.wit +0 -18
- package/wit/deps/io/error.wit +0 -34
- package/wit/deps/io/poll.wit +0 -41
- package/wit/deps/io/streams.wit +0 -262
- package/wit/deps/io/world.wit +0 -6
- package/wit/deps/random/insecure-seed.wit +0 -25
- package/wit/deps/random/insecure.wit +0 -22
- package/wit/deps/random/random.wit +0 -26
- package/wit/deps/random/world.wit +0 -7
- package/wit/deps/sockets/instance-network.wit +0 -9
- package/wit/deps/sockets/ip-name-lookup.wit +0 -51
- package/wit/deps/sockets/network.wit +0 -145
- package/wit/deps/sockets/tcp-create-socket.wit +0 -27
- package/wit/deps/sockets/tcp.wit +0 -353
- package/wit/deps/sockets/udp-create-socket.wit +0 -27
- package/wit/deps/sockets/udp.wit +0 -266
- package/wit/deps/sockets/world.wit +0 -11
- package/wit/deps/webgpu/imports.wit +0 -5
- package/wit/deps.lock +0 -51
- package/wit/deps.toml +0 -18
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
package wasi:sockets@0.3.0;
|
|
2
|
+
|
|
3
|
+
interface types {
|
|
4
|
+
use wasi:clocks/types@0.3.0.{duration};
|
|
5
|
+
|
|
6
|
+
variant error-code {
|
|
7
|
+
access-denied,
|
|
8
|
+
not-supported,
|
|
9
|
+
invalid-argument,
|
|
10
|
+
out-of-memory,
|
|
11
|
+
timeout,
|
|
12
|
+
invalid-state,
|
|
13
|
+
address-not-bindable,
|
|
14
|
+
address-in-use,
|
|
15
|
+
remote-unreachable,
|
|
16
|
+
connection-refused,
|
|
17
|
+
connection-broken,
|
|
18
|
+
connection-reset,
|
|
19
|
+
connection-aborted,
|
|
20
|
+
datagram-too-large,
|
|
21
|
+
other(option<string>),
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
enum ip-address-family {
|
|
25
|
+
ipv4,
|
|
26
|
+
ipv6,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type ipv4-address = tuple<u8, u8, u8, u8>;
|
|
30
|
+
|
|
31
|
+
type ipv6-address = tuple<u16, u16, u16, u16, u16, u16, u16, u16>;
|
|
32
|
+
|
|
33
|
+
variant ip-address {
|
|
34
|
+
ipv4(ipv4-address),
|
|
35
|
+
ipv6(ipv6-address),
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
record ipv4-socket-address {
|
|
39
|
+
port: u16,
|
|
40
|
+
address: ipv4-address,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
record ipv6-socket-address {
|
|
44
|
+
port: u16,
|
|
45
|
+
flow-info: u32,
|
|
46
|
+
address: ipv6-address,
|
|
47
|
+
scope-id: u32,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
variant ip-socket-address {
|
|
51
|
+
ipv4(ipv4-socket-address),
|
|
52
|
+
ipv6(ipv6-socket-address),
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
resource tcp-socket {
|
|
56
|
+
create: static func(address-family: ip-address-family) -> result<tcp-socket, error-code>;
|
|
57
|
+
bind: func(local-address: ip-socket-address) -> result<_, error-code>;
|
|
58
|
+
connect: async func(remote-address: ip-socket-address) -> result<_, error-code>;
|
|
59
|
+
listen: func() -> result<stream<tcp-socket>, error-code>;
|
|
60
|
+
send: func(data: stream<u8>) -> future<result<_, error-code>>;
|
|
61
|
+
receive: func() -> tuple<stream<u8>, future<result<_, error-code>>>;
|
|
62
|
+
get-local-address: func() -> result<ip-socket-address, error-code>;
|
|
63
|
+
get-remote-address: func() -> result<ip-socket-address, error-code>;
|
|
64
|
+
get-is-listening: func() -> bool;
|
|
65
|
+
get-address-family: func() -> ip-address-family;
|
|
66
|
+
set-listen-backlog-size: func(value: u64) -> result<_, error-code>;
|
|
67
|
+
get-keep-alive-enabled: func() -> result<bool, error-code>;
|
|
68
|
+
set-keep-alive-enabled: func(value: bool) -> result<_, error-code>;
|
|
69
|
+
get-keep-alive-idle-time: func() -> result<duration, error-code>;
|
|
70
|
+
set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>;
|
|
71
|
+
get-keep-alive-interval: func() -> result<duration, error-code>;
|
|
72
|
+
set-keep-alive-interval: func(value: duration) -> result<_, error-code>;
|
|
73
|
+
get-keep-alive-count: func() -> result<u32, error-code>;
|
|
74
|
+
set-keep-alive-count: func(value: u32) -> result<_, error-code>;
|
|
75
|
+
get-hop-limit: func() -> result<u8, error-code>;
|
|
76
|
+
set-hop-limit: func(value: u8) -> result<_, error-code>;
|
|
77
|
+
get-receive-buffer-size: func() -> result<u64, error-code>;
|
|
78
|
+
set-receive-buffer-size: func(value: u64) -> result<_, error-code>;
|
|
79
|
+
get-send-buffer-size: func() -> result<u64, error-code>;
|
|
80
|
+
set-send-buffer-size: func(value: u64) -> result<_, error-code>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
resource udp-socket {
|
|
84
|
+
create: static func(address-family: ip-address-family) -> result<udp-socket, error-code>;
|
|
85
|
+
bind: func(local-address: ip-socket-address) -> result<_, error-code>;
|
|
86
|
+
connect: func(remote-address: ip-socket-address) -> result<_, error-code>;
|
|
87
|
+
disconnect: func() -> result<_, error-code>;
|
|
88
|
+
send: async func(data: list<u8>, remote-address: option<ip-socket-address>) -> result<_, error-code>;
|
|
89
|
+
receive: async func() -> result<tuple<list<u8>, ip-socket-address>, error-code>;
|
|
90
|
+
get-local-address: func() -> result<ip-socket-address, error-code>;
|
|
91
|
+
get-remote-address: func() -> result<ip-socket-address, error-code>;
|
|
92
|
+
get-address-family: func() -> ip-address-family;
|
|
93
|
+
get-unicast-hop-limit: func() -> result<u8, error-code>;
|
|
94
|
+
set-unicast-hop-limit: func(value: u8) -> result<_, error-code>;
|
|
95
|
+
get-receive-buffer-size: func() -> result<u64, error-code>;
|
|
96
|
+
set-receive-buffer-size: func(value: u64) -> result<_, error-code>;
|
|
97
|
+
get-send-buffer-size: func() -> result<u64, error-code>;
|
|
98
|
+
set-send-buffer-size: func(value: u64) -> result<_, error-code>;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
interface ip-name-lookup {
|
|
103
|
+
use types.{ip-address};
|
|
104
|
+
|
|
105
|
+
variant error-code {
|
|
106
|
+
access-denied,
|
|
107
|
+
invalid-argument,
|
|
108
|
+
name-unresolvable,
|
|
109
|
+
temporary-resolver-failure,
|
|
110
|
+
permanent-resolver-failure,
|
|
111
|
+
other(option<string>),
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
resolve-addresses: async func(name: string) -> result<list<ip-address>, error-code>;
|
|
115
|
+
}
|
|
116
|
+
|