@bytecodealliance/preview2-shim 0.18.1 → 0.20.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 +15 -15
- package/dist/browser/cli.d.ts +16 -0
- package/dist/browser/cli.js +109 -0
- package/dist/browser/clocks.d.ts +3 -0
- package/dist/browser/clocks.js +36 -0
- package/dist/browser/config.d.ts +2 -0
- package/{lib → dist}/browser/config.js +2 -4
- package/dist/browser/environment.d.ts +5 -0
- package/dist/browser/environment.js +24 -0
- package/dist/browser/filesystem.d.ts +132 -0
- package/dist/browser/filesystem.js +488 -0
- package/dist/browser/http.d.ts +4 -0
- package/dist/browser/http.js +643 -0
- package/dist/browser/index.d.ts +7 -0
- package/dist/browser/index.js +7 -0
- package/dist/browser/io.d.ts +58 -0
- package/dist/browser/io.js +205 -0
- package/dist/browser/random.d.ts +4 -0
- package/dist/browser/random.js +49 -0
- package/dist/browser/sockets.d.ts +8 -0
- package/dist/browser/sockets.js +66 -0
- package/dist/common/instantiation.d.ts +97 -0
- package/dist/common/instantiation.js +228 -0
- package/dist/io/calls.d.ts +91 -0
- package/{lib → dist}/io/calls.js +4 -19
- package/dist/io/worker-http.d.ts +17 -0
- package/dist/io/worker-http.js +192 -0
- package/dist/io/worker-io.d.ts +84 -0
- package/dist/io/worker-io.js +381 -0
- package/dist/io/worker-socket-tcp.d.ts +34 -0
- package/dist/io/worker-socket-tcp.js +251 -0
- package/dist/io/worker-socket-udp.d.ts +54 -0
- package/dist/io/worker-socket-udp.js +493 -0
- package/dist/io/worker-sockets.d.ts +32 -0
- package/dist/io/worker-sockets.js +265 -0
- package/dist/io/worker-thread.d.ts +73 -0
- package/dist/io/worker-thread.js +794 -0
- package/dist/nodejs/cli.d.ts +30 -0
- package/dist/nodejs/cli.js +86 -0
- package/dist/nodejs/clocks.d.ts +3 -0
- package/dist/nodejs/clocks.js +61 -0
- package/dist/nodejs/filesystem.d.ts +113 -0
- package/dist/nodejs/filesystem.js +761 -0
- package/dist/nodejs/http.d.ts +82 -0
- package/dist/nodejs/http.js +674 -0
- package/dist/nodejs/index.d.ts +7 -0
- package/dist/nodejs/index.js +7 -0
- package/dist/nodejs/io.d.ts +1 -0
- package/dist/nodejs/io.js +1 -0
- package/dist/nodejs/random.d.ts +4 -0
- package/dist/nodejs/random.js +42 -0
- package/dist/nodejs/sockets.d.ts +21 -0
- package/dist/nodejs/sockets.js +482 -0
- package/dist/synckit/index.d.ts +2 -0
- package/dist/synckit/index.js +117 -0
- package/package.json +28 -15
- package/types/instantiation.d.ts +7 -7
- package/lib/browser/cli.js +0 -135
- package/lib/browser/clocks.js +0 -39
- package/lib/browser/environment.js +0 -29
- package/lib/browser/filesystem.js +0 -503
- package/lib/browser/http.js +0 -707
- package/lib/browser/index.js +0 -9
- package/lib/browser/io.js +0 -262
- package/lib/browser/random.js +0 -56
- package/lib/browser/sockets.js +0 -88
- package/lib/common/instantiation.js +0 -253
- package/lib/io/worker-http.js +0 -206
- package/lib/io/worker-io.js +0 -468
- package/lib/io/worker-socket-tcp.js +0 -331
- package/lib/io/worker-socket-udp.js +0 -587
- package/lib/io/worker-sockets.js +0 -364
- package/lib/io/worker-thread.js +0 -1051
- package/lib/nodejs/cli.js +0 -109
- package/lib/nodejs/clocks.js +0 -67
- package/lib/nodejs/filesystem.js +0 -829
- package/lib/nodejs/http.js +0 -764
- package/lib/nodejs/index.js +0 -9
- package/lib/nodejs/io.js +0 -1
- package/lib/nodejs/random.js +0 -49
- package/lib/nodejs/sockets.js +0 -565
- 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 {};
|