crates/wit-parser/tests/ui/resources-multiple.wit.json
raw| 1 | { |
| 2 | "worlds": [], |
| 3 | "interfaces": [ |
| 4 | { |
| 5 | "name": "resources-multiple", |
| 6 | "types": { |
| 7 | "r1": 0 |
| 8 | }, |
| 9 | "functions": { |
| 10 | "t1": { |
| 11 | "name": "t1", |
| 12 | "kind": "freestanding", |
| 13 | "params": [ |
| 14 | { |
| 15 | "name": "a", |
| 16 | "type": 1 |
| 17 | } |
| 18 | ] |
| 19 | }, |
| 20 | "t2": { |
| 21 | "name": "t2", |
| 22 | "kind": "freestanding", |
| 23 | "params": [ |
| 24 | { |
| 25 | "name": "a", |
| 26 | "type": 5 |
| 27 | } |
| 28 | ] |
| 29 | }, |
| 30 | "[method]r1.f1": { |
| 31 | "name": "[method]r1.f1", |
| 32 | "kind": { |
| 33 | "method": 0 |
| 34 | }, |
| 35 | "params": [ |
| 36 | { |
| 37 | "name": "self", |
| 38 | "type": 1 |
| 39 | } |
| 40 | ] |
| 41 | }, |
| 42 | "[method]r1.f2": { |
| 43 | "name": "[method]r1.f2", |
| 44 | "kind": { |
| 45 | "method": 0 |
| 46 | }, |
| 47 | "params": [ |
| 48 | { |
| 49 | "name": "self", |
| 50 | "type": 1 |
| 51 | }, |
| 52 | { |
| 53 | "name": "a", |
| 54 | "type": "u32" |
| 55 | } |
| 56 | ] |
| 57 | }, |
| 58 | "[method]r1.f3": { |
| 59 | "name": "[method]r1.f3", |
| 60 | "kind": { |
| 61 | "method": 0 |
| 62 | }, |
| 63 | "params": [ |
| 64 | { |
| 65 | "name": "self", |
| 66 | "type": 1 |
| 67 | }, |
| 68 | { |
| 69 | "name": "a", |
| 70 | "type": "u32" |
| 71 | } |
| 72 | ] |
| 73 | }, |
| 74 | "[method]r1.f4": { |
| 75 | "name": "[method]r1.f4", |
| 76 | "kind": { |
| 77 | "method": 0 |
| 78 | }, |
| 79 | "params": [ |
| 80 | { |
| 81 | "name": "self", |
| 82 | "type": 1 |
| 83 | } |
| 84 | ], |
| 85 | "result": "u32" |
| 86 | }, |
| 87 | "[method]r1.f6": { |
| 88 | "name": "[method]r1.f6", |
| 89 | "kind": { |
| 90 | "method": 0 |
| 91 | }, |
| 92 | "params": [ |
| 93 | { |
| 94 | "name": "self", |
| 95 | "type": 1 |
| 96 | } |
| 97 | ], |
| 98 | "result": 2 |
| 99 | }, |
| 100 | "[method]r1.f7": { |
| 101 | "name": "[method]r1.f7", |
| 102 | "kind": { |
| 103 | "method": 0 |
| 104 | }, |
| 105 | "params": [ |
| 106 | { |
| 107 | "name": "self", |
| 108 | "type": 1 |
| 109 | }, |
| 110 | { |
| 111 | "name": "a", |
| 112 | "type": "f32" |
| 113 | }, |
| 114 | { |
| 115 | "name": "b", |
| 116 | "type": "f32" |
| 117 | } |
| 118 | ], |
| 119 | "result": 2 |
| 120 | }, |
| 121 | "[method]r1.f8": { |
| 122 | "name": "[method]r1.f8", |
| 123 | "kind": { |
| 124 | "method": 0 |
| 125 | }, |
| 126 | "params": [ |
| 127 | { |
| 128 | "name": "self", |
| 129 | "type": 1 |
| 130 | }, |
| 131 | { |
| 132 | "name": "a", |
| 133 | "type": 3 |
| 134 | } |
| 135 | ], |
| 136 | "result": 4 |
| 137 | } |
| 138 | }, |
| 139 | "package": 0 |
| 140 | } |
| 141 | ], |
| 142 | "types": [ |
| 143 | { |
| 144 | "name": "r1", |
| 145 | "kind": "resource", |
| 146 | "owner": { |
| 147 | "interface": 0 |
| 148 | } |
| 149 | }, |
| 150 | { |
| 151 | "name": null, |
| 152 | "kind": { |
| 153 | "handle": { |
| 154 | "borrow": 0 |
| 155 | } |
| 156 | }, |
| 157 | "owner": null |
| 158 | }, |
| 159 | { |
| 160 | "name": null, |
| 161 | "kind": { |
| 162 | "tuple": { |
| 163 | "types": [ |
| 164 | "u32", |
| 165 | "u32" |
| 166 | ] |
| 167 | } |
| 168 | }, |
| 169 | "owner": null |
| 170 | }, |
| 171 | { |
| 172 | "name": null, |
| 173 | "kind": { |
| 174 | "option": "u32" |
| 175 | }, |
| 176 | "owner": null |
| 177 | }, |
| 178 | { |
| 179 | "name": null, |
| 180 | "kind": { |
| 181 | "result": { |
| 182 | "ok": "u32", |
| 183 | "err": "f32" |
| 184 | } |
| 185 | }, |
| 186 | "owner": null |
| 187 | }, |
| 188 | { |
| 189 | "name": null, |
| 190 | "kind": { |
| 191 | "handle": { |
| 192 | "own": 0 |
| 193 | } |
| 194 | }, |
| 195 | "owner": null |
| 196 | } |
| 197 | ], |
| 198 | "packages": [ |
| 199 | { |
| 200 | "name": "foo:resources-multiple", |
| 201 | "interfaces": { |
| 202 | "resources-multiple": 0 |
| 203 | }, |
| 204 | "worlds": {} |
| 205 | } |
| 206 | ] |
| 207 | } |