@@ -96,11 +96,11 @@ using Golem app templates.
9696The following WIT code:
9797
9898``` wit
99- package demo: package ;
99+ package demo:pkg ;
100100
101- world example {
102- export hello: func() -> string;
103- }
101+ world example {
102+ export hello: func() -> string;
103+ }
104104```
105105
106106must be implemented in JavaScript as:
@@ -120,15 +120,15 @@ Exported interfaces has to be exported from JavaScript as objects:
120120The following WIT example:
121121
122122``` wit
123- package demo: package ;
123+ package demo:pkg ;
124124
125- interface sample-api {
126- get-string-length: func(value: string) -> u64;
127- }
125+ interface sample-api {
126+ get-string-length: func(value: string) -> u64;
127+ }
128128
129129world example {
130- export sample-api;
131- }
130+ export sample-api;
131+ }
132132```
133133
134134has to be implemented in JavaScript as:
@@ -151,20 +151,20 @@ Exported resources are implemented as **classes** in JS:
151151The following WIT example:
152152
153153``` wit
154- package demo: package ;
155-
156- interface iface {
157- resource example-resource {
158- constructor(name: string);
159- get-name: func() -> string;
160- compare: static func(h1: borrow<example-resource>, h2: borrow<example-resource>) -> s32;
161- merge: static func(h1: own<example-resource>, h2: own<example-resource>) -> hello;
162- }
163- }
154+ package demo:pkg ;
155+
156+ interface iface {
157+ resource example-resource {
158+ constructor(name: string);
159+ get-name: func() -> string;
160+ compare: static func(h1: borrow<example-resource>, h2: borrow<example-resource>) -> s32;
161+ merge: static func(h1: own<example-resource>, h2: own<example-resource>) -> hello;
162+ }
163+ }
164164
165165world example {
166- export iface;
167- }
166+ export iface;
167+ }
168168```
169169
170170Must be exported from JavaScript in the following way:
0 commit comments