| 1 |
crate::generate!({ |
| 2 |
inline: r#" |
| 3 |
package example:interface-imports; |
| 4 |
|
| 5 |
interface logging { |
| 6 |
enum level { |
| 7 |
debug, |
| 8 |
info, |
| 9 |
warn, |
| 10 |
error, |
| 11 |
} |
| 12 |
|
| 13 |
log: func(level: level, msg: string); |
| 14 |
} |
| 15 |
|
| 16 |
world with-imports { |
| 17 |
// Local interfaces can be imported. |
| 18 |
import logging; |
| 19 |
|
| 20 |
// Dependencies can also be referenced, and they're loaded from the |
| 21 |
// `path` directive specified below. |
| 22 |
import wasi:cli/[email protected]; |
| 23 |
} |
| 24 |
"#, |
| 25 |
|
| 26 |
path: "[email protected]", |
| 27 |
|
| 28 |
// specify that this interface dependency should be generated as well. |
| 29 |
with: { |
| 30 |
"wasi:cli/[email protected]": generate, |
| 31 |
} |
| 32 |
}); |