Files
scratch-wasm/examples/hello/hello.wit
T
2026-06-22 03:48:04 -06:00

53 lines
965 B
Plaintext

package root:component;
world root {
import wasi:cli/stdin@0.2.6;
import wasi:cli/stdout@0.2.6;
import wasi:io/streams@0.2.6;
// export wasi:cli/run@0.2.0;
export hello: func();
}
package wasi:cli@0.2.6 {
interface stdout {
use wasi:io/streams@0.2.6.{output-stream};
get-stdout: func() -> output-stream;
}
interface stdin {
}
}
// package wasi:cli@0.2.0 {
// interface run {
// run: func() -> result;
// }
// }
package wasi:io@0.2.6 {
interface poll {
resource pollable {
block: func();
}
}
interface error {
resource error;
}
interface streams {
use error.{error};
use poll.{pollable};
resource input-stream;
resource output-stream {
write: func(contents: list<u8>) -> result<_, stream-error>;
blocking-write-and-flush: func(contents: list<u8>) ->result<_,stream-error>;
}
variant stream-error {
last-operation-failed(error),
closed,
}
}
}