Uses and includes items from another package.
A synthetic package: it isn't published to any registry.
Interfaces
greeter— Uses types from another package, one under a new name.
Worlds
greeting
Includes a world from another package, and imports one of its interfaces.
Imports
kitchen-sink:types/gates@0.1.0pictures: kitchen-sink:types/resources@0.1.0inline: interfacelog: funcsleep: func[get]volume: func[set]volume: func[constructor]session: func[method]session.end: func
Exports
run: funckitchen-sink:extras/greeter@0.1.0
WIT
/// Uses and includes items from another package.
///
/// A synthetic package: it isn't published to any registry.
package kitchen-sink:extras@0.1.0;
/// Uses types from another package, one under a new name.
interface greeter {
use kitchen-sink:types/shapes@0.1.0.{point, direction as heading};
use kitchen-sink:types/resources@0.1.0.{canvas};
/// Greets a point, facing a heading.
greet: func(name: string, at: point, facing: heading) -> string;
/// Draws a greeting.
draw: func(on: borrow<canvas>, name: string);
}
/// Includes a world from another package, and imports one of its interfaces.
world greeting {
import kitchen-sink:types/gates@0.1.0;
/// An interface under a name of its own.
import pictures: kitchen-sink:types/resources@0.1.0;
/// An inline interface.
import inline: interface {
use kitchen-sink:types/shapes@0.1.0.{point};
ping: func(at: point) -> bool;
}
use kitchen-sink:types/shapes@0.1.0.{direction};
/// A type defined in the world.
type compass = direction;
/// A world-level resource.
resource session {
constructor();
end: func();
}
/// A function.
import log: func(message: string);
/// An async function.
import sleep: async func(ms: u64);
/// A property of the world.
import volume: get() -> u8;
import volume: set(value: u8);
export run: func(args: list<string>) -> result;
export greeter;
}