@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 +2 -2
- package/lib/wasi_snapshot_preview1.command.wasm +0 -0
- package/lib/wasi_snapshot_preview1.reactor.wasm +0 -0
- package/obj/interfaces/wasi-filesystem-types.d.ts +4 -4
- package/obj/interfaces/wasi-io-streams.d.ts +5 -5
- package/obj/js-component-bindgen-component.component.wasm +0 -0
- package/obj/js-component-bindgen-component.core.wasm +0 -0
- package/obj/js-component-bindgen-component.core2.wasm +0 -0
- package/obj/js-component-bindgen-component.d.ts +14 -0
- package/obj/js-component-bindgen-component.js +1001 -735
- package/obj/wasm-tools.component.wasm +0 -0
- package/obj/wasm-tools.core.wasm +0 -0
- package/obj/wasm-tools.core2.wasm +0 -0
- package/obj/wasm-tools.js +1198 -918
- package/package.json +8 -8
- package/src/cmd/componentize.js +1 -1
- package/src/cmd/run.js +7 -3
- package/src/cmd/transpile.js +2 -0
- package/src/jco.js +4 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
## Overview
|
|
22
22
|
|
|
23
|
-
|
|
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
|
-
|
|
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
|
|
|
Binary file
|
|
Binary file
|
|
@@ -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
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -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,
|