@bytecodealliance/jco 1.0.2 → 1.1.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
@@ -20,7 +20,7 @@
20
20
 
21
21
  ## Overview
22
22
 
23
- JCO provides a fully native JS toolchain for working with [WebAssembly Components](https://github.com/WebAssembly/component-model) in JavaScript.
23
+ Jco provides a fully native JS toolchain for working with [WebAssembly Components](https://github.com/WebAssembly/component-model) in JavaScript.
24
24
 
25
25
  Features include:
26
26
 
@@ -40,7 +40,7 @@ For creating components in other languages, see the [Cargo Component](https://gi
40
40
  npm install @bytecodealliance/jco
41
41
  ```
42
42
 
43
- JCO can be used as either a library import or as a CLI via the `jco` command.
43
+ Jco can be used as either a library import or as a CLI via the `jco` command.
44
44
 
45
45
  ## Example
46
46
 
@@ -96,7 +96,7 @@ fn();
96
96
  Imports can be remapped using the `--map` flag, or to provide imports as an argument use the `--instantiation` option.
97
97
 
98
98
  Components relying on WASI bindings will contain external WASI imports, which are automatically updated
99
- to the `@bytecodealliance/preview-shim` package. This package can be installed from npm separately for
99
+ to the `@bytecodealliance/preview2-shim` package. This package can be installed from npm separately for
100
100
  runtime usage. This shim layer supports both Node.js and browsers.
101
101
 
102
102
  Options include:
@@ -13,14 +13,14 @@ export interface StreamErrorClosed {
13
13
  tag: 'closed',
14
14
  }
15
15
 
16
- export class InputStream {
17
- read(len: bigint): Uint8Array;
18
- blockingRead(len: bigint): Uint8Array;
19
- }
20
-
21
16
  export class OutputStream {
22
17
  checkWrite(): bigint;
23
18
  write(contents: Uint8Array): void;
24
19
  blockingWriteAndFlush(contents: Uint8Array): void;
25
20
  blockingFlush(): void;
26
21
  }
22
+
23
+ export class InputStream {
24
+ read(len: bigint): Uint8Array;
25
+ blockingRead(len: bigint): Uint8Array;
26
+ }
@@ -7,10 +7,24 @@ export interface InstantiationModeAsync {
7
7
  export interface InstantiationModeSync {
8
8
  tag: 'sync',
9
9
  }
10
+ export type BindingsMode = BindingsModeJs | BindingsModeHybrid | BindingsModeOptimized | BindingsModeDirectOptimized;
11
+ export interface BindingsModeJs {
12
+ tag: 'js',
13
+ }
14
+ export interface BindingsModeHybrid {
15
+ tag: 'hybrid',
16
+ }
17
+ export interface BindingsModeOptimized {
18
+ tag: 'optimized',
19
+ }
20
+ export interface BindingsModeDirectOptimized {
21
+ tag: 'direct-optimized',
22
+ }
10
23
  export interface GenerateOptions {
11
24
  name: string,
12
25
  noTypescript?: boolean,
13
26
  instantiation?: InstantiationMode,
27
+ importBindings?: BindingsMode,
14
28
  map?: Maps,
15
29
  compat?: boolean,
16
30
  noNodejsCompat?: boolean,