wasm-tools 1.253.0

CLI tools for interoperating with WebAssembly files
Documentation
// RUN: component wit % --wasm | component wit

package a:b;

interface foo {
  @external-id("nested type")
  type t = u32;

  @external-id("nested record")
  record r {
    x: u32,
  }

  @external-id("nested func")
  f: func() -> t;

  @external-id("nested resource")
  resource res {
    @external-id("nested constructor")
    constructor();

    @external-id("nested method")
    m: func();

    @external-id("nested static")
    s: static func();
  }
}

world w {
  @external-id("world type")
  type t2 = u32;

  @external-id("world resource")
  resource r2;

  @external-id("world use")
  use foo.{t};

  @external-id("world func")
  import f2: func() -> t2;

  @external-id("world interface")
  import foo;
}