@bytecodealliance/preview2-shim 0.0.8 → 0.0.10

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 (86) hide show
  1. package/README.md +1 -0
  2. package/lib/browser/cli-base.js +48 -0
  3. package/lib/browser/clocks.js +44 -0
  4. package/lib/browser/filesystem.js +134 -141
  5. package/lib/browser/http.js +114 -0
  6. package/lib/browser/index.js +15 -37
  7. package/lib/browser/io.js +60 -20
  8. package/lib/browser/{console.js → logging.js} +7 -5
  9. package/lib/browser/poll.js +9 -7
  10. package/lib/browser/random.js +48 -24
  11. package/lib/browser/sockets.js +200 -0
  12. package/lib/nodejs/{preopens.js → cli-base.js} +38 -8
  13. package/lib/nodejs/clocks.js +44 -0
  14. package/lib/nodejs/filesystem.js +240 -237
  15. package/lib/nodejs/http.js +114 -0
  16. package/lib/nodejs/index.js +15 -37
  17. package/lib/nodejs/io.js +148 -19
  18. package/lib/nodejs/{console.js → logging.js} +7 -5
  19. package/lib/nodejs/poll.js +9 -7
  20. package/lib/nodejs/random.js +27 -13
  21. package/lib/nodejs/sockets.js +200 -0
  22. package/package.json +1 -1
  23. package/types/exports/{HTTP.d.ts → wasi-http-incoming-handler.d.ts} +1 -1
  24. package/types/imports/environment.d.ts +14 -1
  25. package/types/imports/exit.d.ts +4 -1
  26. package/types/imports/filesystem.d.ts +695 -48
  27. package/types/imports/handler.d.ts +40 -0
  28. package/types/imports/insecure-seed.d.ts +22 -0
  29. package/types/imports/insecure.d.ts +20 -0
  30. package/types/imports/instance-network.d.ts +4 -1
  31. package/types/imports/ip-name-lookup.d.ts +66 -9
  32. package/types/imports/monotonic-clock.d.ts +18 -2
  33. package/types/imports/network.d.ts +171 -9
  34. package/types/imports/{default-outgoing-HTTP.d.ts → outgoing-handler.d.ts} +1 -1
  35. package/types/imports/poll.d.ts +38 -2
  36. package/types/imports/preopens.d.ts +6 -9
  37. package/types/imports/random.d.ts +19 -2
  38. package/types/imports/stderr.d.ts +5 -0
  39. package/types/imports/stdin.d.ts +5 -0
  40. package/types/imports/stdout.d.ts +5 -0
  41. package/types/imports/streams.d.ts +161 -4
  42. package/types/imports/tcp-create-socket.d.ts +27 -3
  43. package/types/imports/tcp.d.ts +248 -15
  44. package/types/imports/timezone.d.ts +60 -2
  45. package/types/imports/types.d.ts +28 -28
  46. package/types/imports/udp-create-socket.d.ts +27 -3
  47. package/types/imports/udp.d.ts +195 -12
  48. package/types/imports/wall-clock.d.ts +24 -1
  49. package/types/wasi-command.d.ts +23 -0
  50. package/types/wasi-proxy.d.ts +10 -44
  51. package/types/wasi-reactor.d.ts +23 -70
  52. package/lib/browser/default-outgoing-HTTP.js +0 -3
  53. package/lib/browser/environment.js +0 -17
  54. package/lib/browser/exit.js +0 -21
  55. package/lib/browser/instance-network.js +0 -3
  56. package/lib/browser/ip-name-lookup.js +0 -23
  57. package/lib/browser/monotonic-clock.js +0 -14
  58. package/lib/browser/network.js +0 -3
  59. package/lib/browser/preopens.js +0 -11
  60. package/lib/browser/stderr.js +0 -4
  61. package/lib/browser/streams.js +0 -60
  62. package/lib/browser/tcp-create-socket.js +0 -3
  63. package/lib/browser/tcp.js +0 -75
  64. package/lib/browser/timezone.js +0 -12
  65. package/lib/browser/types.js +0 -99
  66. package/lib/browser/udp-create-socket.js +0 -3
  67. package/lib/browser/udp.js +0 -75
  68. package/lib/browser/wall-clock.js +0 -9
  69. package/lib/nodejs/default-outgoing-HTTP.js +0 -3
  70. package/lib/nodejs/environment.js +0 -19
  71. package/lib/nodejs/exit.js +0 -3
  72. package/lib/nodejs/instance-network.js +0 -3
  73. package/lib/nodejs/ip-name-lookup.js +0 -23
  74. package/lib/nodejs/monotonic-clock.js +0 -14
  75. package/lib/nodejs/network.js +0 -3
  76. package/lib/nodejs/stderr.js +0 -4
  77. package/lib/nodejs/streams.js +0 -97
  78. package/lib/nodejs/tcp-create-socket.js +0 -3
  79. package/lib/nodejs/tcp.js +0 -75
  80. package/lib/nodejs/timezone.js +0 -12
  81. package/lib/nodejs/types.js +0 -99
  82. package/lib/nodejs/udp-create-socket.js +0 -3
  83. package/lib/nodejs/udp.js +0 -75
  84. package/lib/nodejs/wall-clock.js +0 -9
  85. package/types/imports/console.d.ts +0 -17
  86. package/types/index.d.ts +0 -8
package/lib/nodejs/udp.js DELETED
@@ -1,75 +0,0 @@
1
- export function subscribe () {
2
-
3
- }
4
-
5
- export function dropUdpSocket () {
6
-
7
- }
8
-
9
- export function bind () {
10
-
11
- }
12
-
13
- export function connect () {
14
-
15
- }
16
-
17
- export function receive () {
18
-
19
- }
20
-
21
- export function send () {
22
-
23
- }
24
-
25
- export function localAddress () {
26
-
27
- }
28
-
29
- export function remoteAddress () {
30
-
31
- }
32
-
33
- export function addressFamily () {
34
-
35
- }
36
-
37
- export function ipv6Only () {
38
-
39
- }
40
-
41
- export function setIpv6Only () {
42
-
43
- }
44
-
45
- export function unicastHopLimit () {
46
-
47
- }
48
-
49
- export function setUnicastHopLimit () {
50
-
51
- }
52
-
53
- export function receiveBufferSize () {
54
-
55
- }
56
-
57
- export function setReceiveBufferSize () {
58
-
59
- }
60
-
61
- export function sendBufferSize () {
62
-
63
- }
64
-
65
- export function setSendBufferSize () {
66
-
67
- }
68
-
69
- export function nonBlocking () {
70
-
71
- }
72
-
73
- export function setNonBlocking () {
74
-
75
- }
@@ -1,9 +0,0 @@
1
- export function now() {
2
- const seconds = BigInt(Math.floor(Date.now() / 1e3));
3
- const nanoseconds = (Date.now() % 1e3) * 1e6;
4
- return { seconds, nanoseconds };
5
- }
6
-
7
- export function resolution() {
8
- console.log(`[wall-clock] Wall clock resolution`);
9
- }
@@ -1,17 +0,0 @@
1
- export namespace Console {
2
- export function log(level: Level, context: string, message: string): void;
3
- }
4
- /**
5
- * # Variants
6
- *
7
- * ## `"trace"`
8
- *
9
- * ## `"debug"`
10
- *
11
- * ## `"info"`
12
- *
13
- * ## `"warn"`
14
- *
15
- * ## `"error"`
16
- */
17
- export type Level = 'trace' | 'debug' | 'info' | 'warn' | 'error';
package/types/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { ImportObject as WasiProxyImportObject } from "./wasi-proxy";
2
- import { ImportObject as WasiReactorImportObject } from "./wasi-reactor";
3
-
4
- export type ImportObject = WasiProxyImportObject & WasiReactorImportObject;
5
-
6
- export declare const importObject: ImportObject;
7
-
8
- export default importObject;