@bytecodealliance/jco 1.0.2 → 1.0.3

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
 
@@ -145,6 +145,10 @@ export interface DirectoryEntry {
145
145
  import type { Error } from './wasi-io-streams.js';
146
146
  export { Error };
147
147
 
148
+ export class DirectoryEntryStream {
149
+ readDirectoryEntry(): DirectoryEntry | undefined;
150
+ }
151
+
148
152
  export class Descriptor {
149
153
  readViaStream(offset: Filesize): InputStream;
150
154
  writeViaStream(offset: Filesize): OutputStream;
@@ -157,7 +161,3 @@ export class Descriptor {
157
161
  metadataHash(): MetadataHashValue;
158
162
  metadataHashAt(pathFlags: PathFlags, path: string): MetadataHashValue;
159
163
  }
160
-
161
- export class DirectoryEntryStream {
162
- readDirectoryEntry(): DirectoryEntry | undefined;
163
- }
@@ -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,