feat: add __wasm/rust-wasm-plugins-examples/

This commit is contained in:
2025-07-12 13:22:38 +08:00
parent f2fd57c342
commit e45d14498c
19 changed files with 3195 additions and 11 deletions

View File

@@ -0,0 +1,26 @@
// Note that names *cannot* use underscores, but *can* use dashes
// (In Rust the dashes are converted to underscores, as usual)
// They also can't use numeric digits for some reason!
// A package can include more than one "world"
// (=component, or plugin type for us),
package acme:plugins@1.0.0;
// This is what the host will expose to our plugins
interface host {
log: func(message: string);
}
// This is what our plugins will expose to the host
interface prettify-plugin {
prettify: func(content: string) -> string;
}
// We can create additional worlds per plugin type
// You can import/export more than one interface
// (as well as individual functions, types, and resources)
world prettify {
import host;
export prettify-plugin;
}