@bytecodealliance/preview2-shim 0.0.20 → 0.14.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.
Files changed (43) hide show
  1. package/README.md +4 -14
  2. package/lib/browser/cli.js +77 -12
  3. package/lib/browser/clocks.js +15 -27
  4. package/lib/browser/filesystem.js +147 -205
  5. package/lib/browser/index.js +1 -3
  6. package/lib/{common → browser}/io.js +8 -4
  7. package/lib/common/assert.js +7 -0
  8. package/lib/io/calls.js +64 -0
  9. package/lib/io/worker-http.js +95 -0
  10. package/lib/io/worker-io.js +322 -0
  11. package/lib/io/worker-thread.js +569 -0
  12. package/lib/nodejs/cli.js +45 -58
  13. package/lib/nodejs/clocks.js +13 -27
  14. package/lib/nodejs/filesystem.js +540 -427
  15. package/lib/nodejs/http.js +441 -175
  16. package/lib/nodejs/index.js +4 -1
  17. package/lib/nodejs/io.js +1 -0
  18. package/lib/nodejs/sockets/socket-common.js +116 -0
  19. package/lib/nodejs/sockets/socketopts-bindings.js +94 -0
  20. package/lib/nodejs/sockets/tcp-socket-impl.js +794 -0
  21. package/lib/nodejs/sockets/udp-socket-impl.js +628 -0
  22. package/lib/nodejs/sockets/wasi-sockets.js +320 -0
  23. package/lib/nodejs/sockets.js +11 -200
  24. package/lib/synckit/index.js +4 -2
  25. package/package.json +1 -5
  26. package/types/interfaces/wasi-cli-terminal-input.d.ts +4 -0
  27. package/types/interfaces/wasi-cli-terminal-output.d.ts +4 -0
  28. package/types/interfaces/wasi-clocks-monotonic-clock.d.ts +19 -6
  29. package/types/interfaces/wasi-filesystem-types.d.ts +1 -178
  30. package/types/interfaces/wasi-http-outgoing-handler.d.ts +2 -2
  31. package/types/interfaces/wasi-http-types.d.ts +412 -82
  32. package/types/interfaces/wasi-io-error.d.ts +16 -0
  33. package/types/interfaces/wasi-io-poll.d.ts +19 -8
  34. package/types/interfaces/wasi-io-streams.d.ts +26 -46
  35. package/types/interfaces/wasi-sockets-ip-name-lookup.d.ts +9 -21
  36. package/types/interfaces/wasi-sockets-network.d.ts +4 -0
  37. package/types/interfaces/wasi-sockets-tcp.d.ts +75 -18
  38. package/types/interfaces/wasi-sockets-udp-create-socket.d.ts +1 -1
  39. package/types/interfaces/wasi-sockets-udp.d.ts +282 -193
  40. package/types/wasi-cli-command.d.ts +28 -28
  41. package/types/wasi-http-proxy.d.ts +12 -12
  42. package/lib/common/make-request.js +0 -30
  43. package/types/interfaces/wasi-clocks-timezone.d.ts +0 -56
@@ -1,56 +0,0 @@
1
- export namespace WasiClocksTimezone {
2
- /**
3
- * Return information needed to display the given `datetime`. This includes
4
- * the UTC offset, the time zone name, and a flag indicating whether
5
- * daylight saving time is active.
6
- *
7
- * If the timezone cannot be determined for the given `datetime`, return a
8
- * `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight
9
- * saving time.
10
- */
11
- export function display(when: Datetime): TimezoneDisplay;
12
- /**
13
- * The same as `display`, but only return the UTC offset.
14
- */
15
- export function utcOffset(when: Datetime): number;
16
- }
17
- import type { Datetime } from '../interfaces/wasi-clocks-wall-clock.js';
18
- export { Datetime };
19
- /**
20
- * Information useful for displaying the timezone of a specific `datetime`.
21
- *
22
- * This information may vary within a single `timezone` to reflect daylight
23
- * saving time adjustments.
24
- */
25
- export interface TimezoneDisplay {
26
- /**
27
- * The number of seconds difference between UTC time and the local
28
- * time of the timezone.
29
- *
30
- * The returned value will always be less than 86400 which is the
31
- * number of seconds in a day (24*60*60).
32
- *
33
- * In implementations that do not expose an actual time zone, this
34
- * should return 0.
35
- */
36
- utcOffset: number,
37
- /**
38
- * The abbreviated name of the timezone to display to a user. The name
39
- * `UTC` indicates Coordinated Universal Time. Otherwise, this should
40
- * reference local standards for the name of the time zone.
41
- *
42
- * In implementations that do not expose an actual time zone, this
43
- * should be the string `UTC`.
44
- *
45
- * In time zones that do not have an applicable name, a formatted
46
- * representation of the UTC offset may be returned, such as `-04:00`.
47
- */
48
- name: string,
49
- /**
50
- * Whether daylight saving time is active.
51
- *
52
- * In implementations that do not expose an actual time zone, this
53
- * should return false.
54
- */
55
- inDaylightSavingTime: boolean,
56
- }