wasm-tools 1.240.0

CLI tools for interoperating with WebAssembly files
Documentation
// RUN: component wit --features foo %

package a:b;

@unstable(feature = foo)
interface foo {
  @unstable(feature = foo)
  type t = u32;
}

@unstable(feature = foo)
interface bar {
  @unstable(feature = foo)
  use foo.{t};

  @unstable(feature = foo)
  record x { y: t }
}

@unstable(feature = foo)
world the-world {
  @unstable(feature = foo)
  import foo;
  @unstable(feature = foo)
  export bar;

  @unstable(feature = foo)
  import x: func();
  @unstable(feature = foo)
  export y: func();

  @unstable(feature = foo)
  resource thing {
    @unstable(feature = foo)
    constructor();
  }
}

interface another-interface {
  @unstable(feature = foo)
  resource x {
    @unstable(feature = foo)
    constructor();

    @unstable(feature = foo)
    x: static func();

    @unstable(feature = foo)
    y: func();
  }

  @unstable(feature = foo)
  variant y {
    x(x),
  }
}