@@ -28,34 +28,34 @@ pub type Promise(value)
28
28
/// This function is useful for converting code that uses callbacks into code
29
29
/// that uses promises.
30
30
///
31
- @ external ( javascript , "../../ffi .mjs" , "newPromise" )
31
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "newPromise" )
32
32
pub fn new ( a : fn ( fn ( value) -> Nil ) -> Nil ) -> Promise ( value)
33
33
34
34
/// Create a promise that resolves immediately.
35
35
///
36
- @ external ( javascript , "../../ffi .mjs" , "resolve" )
36
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "resolve" )
37
37
pub fn resolve ( a : value) -> Promise ( value)
38
38
39
39
/// If the promise is in an error state then apply a function to convert the
40
40
/// error value back into valid value, making the promise healthy again.
41
41
///
42
42
/// This is the equivilent of the `promise.catch` JavaScript method.
43
43
///
44
- @ external ( javascript , "../../ffi .mjs" , "rescue" )
44
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "rescue" )
45
45
pub fn rescue ( a : Promise ( value) , b : fn ( Dynamic ) -> value) -> Promise ( value)
46
46
47
47
/// Chain a second asynchronous operation onto a promise, so it runs after the
48
48
/// promise has resolved.
49
49
///
50
50
/// This is the equivilent of the `promise.then` JavaScript method.
51
51
///
52
- @ external ( javascript , "../../ffi .mjs" , "then" )
52
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "then" )
53
53
pub fn await ( a : Promise ( a) , b : fn ( a) -> Promise ( b) ) -> Promise ( b)
54
54
55
55
/// Run a function on the value a promise resolves to, after it has resolved.
56
56
/// The value returned becomes the new value contained by the promise.
57
57
///
58
- @ external ( javascript , "../../ffi .mjs" , "map_promise" )
58
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "map_promise" )
59
59
pub fn map ( a : Promise ( a) , b : fn ( a) -> b) -> Promise ( b)
60
60
61
61
/// Run a function on the value a promise resolves to, after it has resolved.
@@ -116,15 +116,15 @@ pub fn try_await(
116
116
///
117
117
/// This is the equivilent of the `Promise.all` JavaScript static method.
118
118
///
119
- @ external ( javascript , "../../ffi .mjs" , "all_promises" )
119
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "all_promises" )
120
120
pub fn await2 ( a : Promise ( a) , b : Promise ( b) ) -> Promise ( # ( a, b) )
121
121
122
122
/// Chain an asynchronous operation onto 3 promises, so it runs after the
123
123
/// promises have resolved.
124
124
///
125
125
/// This is the equivilent of the `Promise.all` JavaScript static method.
126
126
///
127
- @ external ( javascript , "../../ffi .mjs" , "all_promises" )
127
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "all_promises" )
128
128
pub fn await3 (
129
129
a : Promise ( a) ,
130
130
b : Promise ( b) ,
@@ -136,7 +136,7 @@ pub fn await3(
136
136
///
137
137
/// This is the equivilent of the `Promise.all` JavaScript static method.
138
138
///
139
- @ external ( javascript , "../../ffi .mjs" , "all_promises" )
139
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "all_promises" )
140
140
pub fn await4 (
141
141
a : Promise ( a) ,
142
142
b : Promise ( b) ,
@@ -149,7 +149,7 @@ pub fn await4(
149
149
///
150
150
/// This is the equivilent of the `Promise.all` JavaScript static method.
151
151
///
152
- @ external ( javascript , "../../ffi .mjs" , "all_promises" )
152
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "all_promises" )
153
153
pub fn await5 (
154
154
a : Promise ( a) ,
155
155
b : Promise ( b) ,
@@ -163,7 +163,7 @@ pub fn await5(
163
163
///
164
164
/// This is the equivilent of the `Promise.all` JavaScript static method.
165
165
///
166
- @ external ( javascript , "../../ffi .mjs" , "all_promises" )
166
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "all_promises" )
167
167
pub fn await6 (
168
168
a : Promise ( a) ,
169
169
b : Promise ( b) ,
@@ -178,7 +178,7 @@ pub fn await6(
178
178
///
179
179
/// This is the equivilent of the `Promise.all` JavaScript static method.
180
180
///
181
- @ external ( javascript , "../../ffi .mjs" , "all_promises" )
181
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "all_promises" )
182
182
pub fn await_array ( a : Array ( Promise ( a) ) ) -> Promise ( Array ( a) )
183
183
184
184
/// Chain an asynchronous operation onto an list of promises, so it runs after the
@@ -192,24 +192,24 @@ pub fn await_list(xs: List(Promise(a))) -> Promise(List(a)) {
192
192
|> map ( array . to_list )
193
193
}
194
194
195
- @ external ( javascript , "../../ffi .mjs" , "all_promises" )
195
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "all_promises" )
196
196
fn do_await_list ( a : List ( Promise ( a) ) ) -> Promise ( Array ( a) )
197
197
198
- @ external ( javascript , "../../ffi .mjs" , "race_promises" )
198
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "race_promises" )
199
199
pub fn race2 ( a : Promise ( a) , b : Promise ( a) ) -> Promise ( a)
200
200
201
- @ external ( javascript , "../../ffi .mjs" , "race_promises" )
201
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "race_promises" )
202
202
pub fn race3 ( a : Promise ( a) , b : Promise ( a) , c : Promise ( a) ) -> Promise ( a)
203
203
204
- @ external ( javascript , "../../ffi .mjs" , "race_promises" )
204
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "race_promises" )
205
205
pub fn race4 (
206
206
a : Promise ( a) ,
207
207
b : Promise ( a) ,
208
208
c : Promise ( a) ,
209
209
d : Promise ( a) ,
210
210
) -> Promise ( a)
211
211
212
- @ external ( javascript , "../../ffi .mjs" , "race_promises" )
212
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "race_promises" )
213
213
pub fn race5 (
214
214
a : Promise ( a) ,
215
215
b : Promise ( a) ,
@@ -218,7 +218,7 @@ pub fn race5(
218
218
e : Promise ( a) ,
219
219
) -> Promise ( a)
220
220
221
- @ external ( javascript , "../../ffi .mjs" , "race_promises" )
221
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "race_promises" )
222
222
pub fn race6 (
223
223
a : Promise ( a) ,
224
224
b : Promise ( a) ,
@@ -228,8 +228,8 @@ pub fn race6(
228
228
f : Promise ( a) ,
229
229
) -> Promise ( a)
230
230
231
- @ external ( javascript , "../../ffi .mjs" , "race_promises" )
231
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "race_promises" )
232
232
pub fn race_list ( a : List ( Promise ( a) ) ) -> Promise ( a)
233
233
234
- @ external ( javascript , "../../ffi .mjs" , "race_promises" )
234
+ @ external ( javascript , "../../gleam_javascript_ffi .mjs" , "race_promises" )
235
235
pub fn race_array ( a : Array ( Promise ( a) ) ) -> Promise ( a)
0 commit comments