package test:main; interface iface1 { flags permissions { read, write, exec, close } record metadata { name: string, origin: string, perms: permissions } record point { x: s32, y: s32, metadata: metadata } type point-tuple = tuple; add: func(x: s32, y: s32) -> s64; point-to-string: func(p: point) -> string; points-to-strings: func(ps: list) -> list; tuple-to-point: func(t: point-tuple, metadata: option) -> result; process-result: func(r: result); new-point: func(x: s32, y: s32, metadata: metadata) -> point; get-metadata: func() -> option; record product-item { product-id: string, name: string, price: float32, quantity: u32, } record order { order-id: string, items: list, total: float32, timestamp: u64, } record order-confirmation { order-id: string, } variant checkout-result { error(string), success(order-confirmation), } resource cart { constructor(user-id: string); add-item: func(item: product-item) -> (); remove-item: func(product-id: string) -> (); update-item-quantity: func(product-id: string, quantity: u32) -> (); checkout: func() -> checkout-result; get-cart-contents: func() -> list; merge-with: func(other-cart: borrow) -> (); merge: static func(cart1: borrow, cart2: borrow) -> cart; } } world api { export iface1; export test:dep1/iface2@0.1.0; export run: func(param: string); }