Includes a world from another package, and imports one of its interfaces.
Imports
- interface
kitchen-sink:types/gates@0.1.0 interface
kitchen-sink:types/primitives@0.1.0An interface, by its path in the package.
- interface
kitchen-sink:types/containers@0.1.0 - interface
kitchen-sink:types/shapes@0.1.0 interface
pictures:kitchen-sink:types/resources@0.1.0An interface under a name of its own.
- interface
kitchen-sink:types/resources@0.1.0
interface inline
inlineAn inline interface.
use record point
pointping: func(at: point) -> bool
use enum direction
directiontype compass
compassA type defined in the world.
resource session
sessionA world-level resource.
constructor()end: func()
log: func(message: string)
log: func(message: string)A function.
sleep: async func(ms: u64)
sleep: async func(ms: u64)An async function.
volume: get() -> u8
volume: get() -> u8A property of the world.
volume: set(value: u8)
Exports
- interface
kitchen-sink:extras/greeter@0.1.0 - interface
kitchen-sink:types/concurrency@0.1.0
run: func(args: list<string>) -> result
WIT
/// Includes a world from another package, and imports one of its interfaces.
world greeting {
import kitchen-sink:types/gates@0.1.0;
/// An interface, by its path in the package.
import kitchen-sink:types/primitives@0.1.0;
import kitchen-sink:types/containers@0.1.0;
import kitchen-sink:types/shapes@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;
}
import kitchen-sink:types/resources@0.1.0;
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;
export kitchen-sink:types/concurrency@0.1.0;
}