@bytecodealliance/preview2-shim 0.18.1 → 0.19.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 (81) hide show
  1. package/dist/browser/cli.d.ts +16 -0
  2. package/dist/browser/cli.js +109 -0
  3. package/dist/browser/clocks.d.ts +3 -0
  4. package/dist/browser/clocks.js +36 -0
  5. package/dist/browser/config.d.ts +2 -0
  6. package/{lib → dist}/browser/config.js +2 -4
  7. package/dist/browser/environment.d.ts +5 -0
  8. package/dist/browser/environment.js +24 -0
  9. package/dist/browser/filesystem.d.ts +132 -0
  10. package/dist/browser/filesystem.js +464 -0
  11. package/dist/browser/http.d.ts +4 -0
  12. package/dist/browser/http.js +643 -0
  13. package/dist/browser/index.d.ts +7 -0
  14. package/dist/browser/index.js +7 -0
  15. package/dist/browser/io.d.ts +58 -0
  16. package/dist/browser/io.js +205 -0
  17. package/dist/browser/random.d.ts +4 -0
  18. package/dist/browser/random.js +49 -0
  19. package/dist/browser/sockets.d.ts +8 -0
  20. package/dist/browser/sockets.js +66 -0
  21. package/dist/common/instantiation.d.ts +97 -0
  22. package/dist/common/instantiation.js +227 -0
  23. package/dist/io/calls.d.ts +91 -0
  24. package/{lib → dist}/io/calls.js +4 -19
  25. package/dist/io/worker-http.d.ts +17 -0
  26. package/dist/io/worker-http.js +192 -0
  27. package/dist/io/worker-io.d.ts +84 -0
  28. package/dist/io/worker-io.js +375 -0
  29. package/dist/io/worker-socket-tcp.d.ts +34 -0
  30. package/dist/io/worker-socket-tcp.js +251 -0
  31. package/dist/io/worker-socket-udp.d.ts +54 -0
  32. package/dist/io/worker-socket-udp.js +492 -0
  33. package/dist/io/worker-sockets.d.ts +32 -0
  34. package/dist/io/worker-sockets.js +265 -0
  35. package/dist/io/worker-thread.d.ts +73 -0
  36. package/dist/io/worker-thread.js +791 -0
  37. package/dist/nodejs/cli.d.ts +30 -0
  38. package/dist/nodejs/cli.js +86 -0
  39. package/dist/nodejs/clocks.d.ts +3 -0
  40. package/dist/nodejs/clocks.js +61 -0
  41. package/dist/nodejs/filesystem.d.ts +113 -0
  42. package/dist/nodejs/filesystem.js +758 -0
  43. package/dist/nodejs/http.d.ts +82 -0
  44. package/dist/nodejs/http.js +674 -0
  45. package/dist/nodejs/index.d.ts +7 -0
  46. package/dist/nodejs/index.js +7 -0
  47. package/dist/nodejs/io.d.ts +1 -0
  48. package/dist/nodejs/io.js +1 -0
  49. package/dist/nodejs/random.d.ts +4 -0
  50. package/dist/nodejs/random.js +42 -0
  51. package/dist/nodejs/sockets.d.ts +21 -0
  52. package/dist/nodejs/sockets.js +482 -0
  53. package/dist/synckit/index.d.ts +2 -0
  54. package/dist/synckit/index.js +117 -0
  55. package/package.json +26 -13
  56. package/types/instantiation.d.ts +7 -7
  57. package/lib/browser/cli.js +0 -135
  58. package/lib/browser/clocks.js +0 -39
  59. package/lib/browser/environment.js +0 -29
  60. package/lib/browser/filesystem.js +0 -503
  61. package/lib/browser/http.js +0 -707
  62. package/lib/browser/index.js +0 -9
  63. package/lib/browser/io.js +0 -262
  64. package/lib/browser/random.js +0 -56
  65. package/lib/browser/sockets.js +0 -88
  66. package/lib/common/instantiation.js +0 -253
  67. package/lib/io/worker-http.js +0 -206
  68. package/lib/io/worker-io.js +0 -468
  69. package/lib/io/worker-socket-tcp.js +0 -331
  70. package/lib/io/worker-socket-udp.js +0 -587
  71. package/lib/io/worker-sockets.js +0 -364
  72. package/lib/io/worker-thread.js +0 -1051
  73. package/lib/nodejs/cli.js +0 -109
  74. package/lib/nodejs/clocks.js +0 -67
  75. package/lib/nodejs/filesystem.js +0 -829
  76. package/lib/nodejs/http.js +0 -764
  77. package/lib/nodejs/index.js +0 -9
  78. package/lib/nodejs/io.js +0 -1
  79. package/lib/nodejs/random.js +0 -49
  80. package/lib/nodejs/sockets.js +0 -565
  81. package/lib/synckit/index.js +0 -127
@@ -0,0 +1,82 @@
1
+ import type { types as TypesNamespace } from "../../types/http.js";
2
+ import { OutputStream, Pollable } from "../../types/interfaces/wasi-io-streams.js";
3
+ declare const symbolDispose: symbol;
4
+ export declare const _forbiddenHeaders: Set<string>;
5
+ declare class OutgoingRequest implements TypesNamespace.OutgoingRequest {
6
+ #private;
7
+ [symbolDispose]: () => void;
8
+ constructor(headers: any);
9
+ body(): OutgoingBody;
10
+ method(): TypesNamespace.Method;
11
+ setMethod(method: any): void;
12
+ pathWithQuery(): string | undefined;
13
+ setPathWithQuery(pathWithQuery: any): void;
14
+ scheme(): TypesNamespace.Scheme | undefined;
15
+ setScheme(scheme: any): void;
16
+ authority(): string | undefined;
17
+ setAuthority(authority: any): void;
18
+ headers(): Fields;
19
+ static _handle(request: any, options: any): FutureIncomingResponse;
20
+ }
21
+ declare class OutgoingBody implements TypesNamespace.OutgoingBody {
22
+ #private;
23
+ [symbolDispose]: () => void;
24
+ write(): OutputStream;
25
+ static finish(body: OutgoingBody, trailers: Fields | undefined): void;
26
+ static _outputStreamId(outgoingBody: any): any;
27
+ static _create(contentLength: any): OutgoingBody;
28
+ }
29
+ declare class FutureIncomingResponse implements TypesNamespace.FutureIncomingResponse {
30
+ #private;
31
+ [symbolDispose]: () => void;
32
+ subscribe(): Pollable;
33
+ get(): any;
34
+ static _create(method: any, scheme: any, authority: any, pathWithQuery: any, headers: any, body: any, connectTimeout: any, betweenBytesTimeout: any, firstByteTimeout: any): FutureIncomingResponse;
35
+ }
36
+ declare class Fields {
37
+ #private;
38
+ /**
39
+ * @param {[string, Uint8Array[][]][]} entries
40
+ */
41
+ static fromList(entries: any): Fields;
42
+ get(name: any): TypesNamespace.FieldValue[];
43
+ /**
44
+ * WIT spec (https://github.com/WebAssembly/WASI/blob/91bb44c3c3a9b1e09187db23c85fa844d1fd6b15/proposals/http/wit/types.wit#L215-L223):
45
+ *
46
+ * > Set all of the values for a name. Clears any existing values for that
47
+ * > name, if they have been set.
48
+ * >
49
+ * > Fails with `header-error.immutable` if the `fields` are immutable.
50
+ * >
51
+ * > Fails with `header-error.invalid-syntax` if the `field-name` or any of
52
+ * > the `field-value`s are syntactically invalid.
53
+ *
54
+ * The existing-branch splice/reuse is an allocation optimization — values are cleared, not retained.
55
+ */
56
+ set(name: any, values: any): void;
57
+ has(name: any): boolean;
58
+ delete(name: any): void;
59
+ append(name: any, value: any): void;
60
+ entries(): [string, TypesNamespace.FieldValue][];
61
+ clone(): Fields;
62
+ static _lock(fields: any): any;
63
+ static _fromEntriesChecked(entries: any): Fields;
64
+ }
65
+ export declare const outgoingHandler: {
66
+ /**
67
+ * @param {OutgoingRequest} request
68
+ * @param {RequestOptions | undefined} options
69
+ * @returns {FutureIncomingResponse}
70
+ */
71
+ handle: typeof OutgoingRequest._handle;
72
+ };
73
+ export declare const types: typeof TypesNamespace;
74
+ export declare class HTTPServer {
75
+ #private;
76
+ constructor(incomingHandler: any);
77
+ listen(port: any, host: any): void;
78
+ address(): any;
79
+ stop(): void;
80
+ close(): void;
81
+ }
82
+ export {};