Uses types from another package, one under a new name.
Types
use resource canvas
from kitchen-sink:types/resources@0.1.0
A resource with every kind of member.
constructor(width: u32, height: u32)Makes an empty canvas.
plot: func(at: point, color: list<u8, 4>)A method.
copy-from: func(other: borrow<canvas>) -> result<_, string>A method that borrows another canvas.
snapshot: func() -> canvasA method that hands back a resource it owns.
render: async func() -> list<u8>An async method.
open: static func(path: string) -> result<canvas, string>A static function.
load: static async func(url: string) -> result<canvas, string>A static async function.
title: get() -> stringA property with a getter and a setter.
title: set(value: string)area: get() -> u64A property with a getter alone.
max-size: static get() -> u32A static property.
max-size: static set(value: u32) -> result<_, string>
Functions
draw: func(on: borrow<canvas>, name: string)
Draws a greeting.
WIT
/// 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);
}