package golem:rpc@0.1.0; interface types { use wasi:io/poll@0.2.0.{pollable}; type node-index = s32; record wit-value { nodes: list, } variant wit-node { record-value(list), variant-value(tuple>), enum-value(u32), flags-value(list), tuple-value(list), list-value(list), option-value(option), result-value(result, option>), prim-u8(u8), prim-u16(u16), prim-u32(u32), prim-u64(u64), prim-s8(s8), prim-s16(s16), prim-s32(s32), prim-s64(s64), prim-float32(float32), prim-float64(float64), prim-char(char), prim-bool(bool), prim-string(string), handle(tuple) } record uri { value: string, } variant rpc-error { protocol-error(string), denied(string), not-found(string), remote-internal-error(string) } resource wasm-rpc { constructor(location: uri); invoke-and-await: func(function-name: string, function-params: list) -> result; invoke: func(function-name: string, function-params: list) -> result<_, rpc-error>; async-invoke-and-await: func(function-name: string, function-params: list) -> future-invoke-result; } resource future-invoke-result { subscribe: func() -> pollable; get: func() -> option>; } } world wit-value { import types; }