wasm-wave 0.248.0

WebAssembly Value Encoding
Documentation
// Regenerate types.wasm:
// wasm-tools component embed --dummy types.wit | wasm-tools component new -o types.wasm

package tests:tests

world tests {
    export bools: func() -> tuple<bool, bool>
    export sints: func() -> tuple<s8, s16, s32, s64>
    export uints: func() -> tuple<u8, u16, u32, u64>
    export floats: func() -> tuple<f32, f64>
    export options: func() -> tuple<option<u8>, option<option<s8>>>
    export list-chars: func() -> list<char>
    export list-strings: func() -> list<string>
    export result-ok-only: func() -> result<u8>
    export result-err-only: func() -> result<_, s8>
    export result-no-payloads: func() -> result
    export result-both-payloads: func() -> result<u8, s8>

    record record-type {
        required: u8,
        optional: option<u8>,
    }
    export %record: func() -> record-type

    variant variant-type {
        without-payload,
        with-payload(u8),
    }
    export %variant: func() -> variant-type

    enum enum-type {
        first,
        second,
    }
    export %enum: func() -> enum-type

    flags flags-type {
        read,
        write,
    }
    export %flags: func() -> flags-type

    export func-type: func(a: bool, b: enum-type) -> result<u8>
}