@bytecodealliance/jco 1.8.1 → 1.10.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 CHANGED
@@ -60,6 +60,7 @@ Commands:
60
60
  componentize [options] <js-source> Create a component from a JavaScript module
61
61
  transpile [options] <component-path> Transpile a WebAssembly Component to JS + core Wasm for JavaScript execution
62
62
  types [options] <wit-path> Generate types for the given WIT
63
+ guest-types [options] <wit-path> (experimental) Generate guest types for the given WIT
63
64
  run [options] <command> [args...] Run a WASI Command component
64
65
  serve [options] <server> [args...] Serve a WASI HTTP component
65
66
  opt [options] <component-file> optimizes a Wasm component, including running wasm-opt Binaryen optimizations
@@ -45,6 +45,7 @@ export interface ModuleMetaTypeComponent {
45
45
  val: number,
46
46
  }
47
47
  export interface ModuleMetadata {
48
+ parentIndex?: number,
48
49
  name?: string,
49
50
  metaType: ModuleMetaType,
50
51
  range: [number, number],
@@ -3,4 +3,8 @@ export namespace WasiCliTerminalInput {
3
3
  }
4
4
 
5
5
  export class TerminalInput {
6
+ /**
7
+ * This type does not have a public constructor.
8
+ */
9
+ private constructor();
6
10
  }
@@ -3,4 +3,8 @@ export namespace WasiCliTerminalOutput {
3
3
  }
4
4
 
5
5
  export class TerminalOutput {
6
+ /**
7
+ * This type does not have a public constructor.
8
+ */
9
+ private constructor();
6
10
  }
@@ -146,6 +146,10 @@ import type { Error } from './wasi-io-streams.js';
146
146
  export { Error };
147
147
 
148
148
  export class Descriptor {
149
+ /**
150
+ * This type does not have a public constructor.
151
+ */
152
+ private constructor();
149
153
  readViaStream(offset: Filesize): InputStream;
150
154
  writeViaStream(offset: Filesize): OutputStream;
151
155
  appendViaStream(): OutputStream;
@@ -159,5 +163,9 @@ export class Descriptor {
159
163
  }
160
164
 
161
165
  export class DirectoryEntryStream {
166
+ /**
167
+ * This type does not have a public constructor.
168
+ */
169
+ private constructor();
162
170
  readDirectoryEntry(): DirectoryEntry | undefined;
163
171
  }
@@ -3,4 +3,8 @@ export namespace WasiIoError {
3
3
  }
4
4
 
5
5
  export class Error {
6
+ /**
7
+ * This type does not have a public constructor.
8
+ */
9
+ private constructor();
6
10
  }
@@ -14,11 +14,19 @@ export interface StreamErrorClosed {
14
14
  }
15
15
 
16
16
  export class InputStream {
17
+ /**
18
+ * This type does not have a public constructor.
19
+ */
20
+ private constructor();
17
21
  read(len: bigint): Uint8Array;
18
22
  blockingRead(len: bigint): Uint8Array;
19
23
  }
20
24
 
21
25
  export class OutputStream {
26
+ /**
27
+ * This type does not have a public constructor.
28
+ */
29
+ private constructor();
22
30
  checkWrite(): bigint;
23
31
  write(contents: Uint8Array): void;
24
32
  blockingWriteAndFlush(contents: Uint8Array): void;
@@ -20,6 +20,18 @@ export interface BindingsModeOptimized {
20
20
  export interface BindingsModeDirectOptimized {
21
21
  tag: 'direct-optimized',
22
22
  }
23
+ export interface AsyncImportsExports {
24
+ imports: Array<string>,
25
+ exports: Array<string>,
26
+ }
27
+ export type AsyncMode = AsyncModeSync | AsyncModeJspi;
28
+ export interface AsyncModeSync {
29
+ tag: 'sync',
30
+ }
31
+ export interface AsyncModeJspi {
32
+ tag: 'jspi',
33
+ val: AsyncImportsExports,
34
+ }
23
35
  export interface GenerateOptions {
24
36
  name: string,
25
37
  noTypescript?: boolean,
@@ -33,7 +45,9 @@ export interface GenerateOptions {
33
45
  validLiftingOptimization?: boolean,
34
46
  tracing?: boolean,
35
47
  noNamespacedExports?: boolean,
48
+ guest?: boolean,
36
49
  multiMemory?: boolean,
50
+ asyncMode?: AsyncMode,
37
51
  }
38
52
  export type Wit = WitSource | WitBinary | WitPath;
39
53
  export interface WitSource {
@@ -63,6 +77,8 @@ export interface TypeGenerationOptions {
63
77
  instantiation?: InstantiationMode,
64
78
  map?: Maps,
65
79
  features?: EnabledFeatureSet,
80
+ guest?: boolean,
81
+ asyncMode?: AsyncMode,
66
82
  }
67
83
  /**
68
84
  * # Variants