Skip to content

Commit 426e92e

Browse files
CrowdHailerlpil
authored andcommitted
rename ffi file
1 parent 2cf699d commit 426e92e

File tree

6 files changed

+39
-35
lines changed

6 files changed

+39
-35
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
- Renamed ffi file to be scope with project name.
6+
37
## v0.10.0 - 2024-06-23
48

59
- The `Reference` type has been deprecated.

src/gleam/javascript.gleam

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub type Symbol
3333
/// For further information view the MDN documentation:
3434
/// <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol>
3535
///
36-
@external(javascript, "../ffi.mjs", "type_of")
36+
@external(javascript, "../gleam_javascript_ffi.mjs", "type_of")
3737
pub fn type_of(a: value) -> TypeOf
3838

3939
/// Use the JavaScript `Symbol.for` method to look up a symbol with the given
@@ -42,22 +42,22 @@ pub fn type_of(a: value) -> TypeOf
4242
/// For further information see the MDN documentation:
4343
/// <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/for>
4444
///
45-
@external(javascript, "../ffi.mjs", "get_symbol")
45+
@external(javascript, "../gleam_javascript_ffi.mjs", "get_symbol")
4646
pub fn get_symbol(a: String) -> Symbol
4747

4848
@deprecated("The Reference type is being removed from this packge")
4949
pub type Reference(value)
5050

5151
@deprecated("The Reference type is being removed from this packge")
52-
@external(javascript, "../ffi.mjs", "dereference")
52+
@external(javascript, "../gleam_javascript_ffi.mjs", "dereference")
5353
pub fn dereference(a: Reference(a)) -> a
5454

5555
@deprecated("The Reference type is being removed from this packge")
56-
@external(javascript, "../ffi.mjs", "set_reference")
56+
@external(javascript, "../gleam_javascript_ffi.mjs", "set_reference")
5757
pub fn set_reference(a: Reference(a), b: a) -> a
5858

5959
@deprecated("The Reference type is being removed from this packge")
60-
@external(javascript, "../ffi.mjs", "make_reference")
60+
@external(javascript, "../gleam_javascript_ffi.mjs", "make_reference")
6161
pub fn make_reference(a: a) -> Reference(a)
6262

6363
@deprecated("The Reference type is being removed from this packge")
@@ -68,5 +68,5 @@ pub fn update_reference(ref: Reference(a), f: fn(a) -> a) -> a {
6868
}
6969

7070
@deprecated("The Reference type is being removed from this packge")
71-
@external(javascript, "../ffi.mjs", "reference_equal")
71+
@external(javascript, "../gleam_javascript_ffi.mjs", "reference_equal")
7272
pub fn reference_equal(a: Reference(a), b: Reference(a)) -> Bool

src/gleam/javascript/array.gleam

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ pub fn to_list(a: Array(element)) -> List(element)
1515
///
1616
/// Runs in linear time.
1717
///
18-
@external(javascript, "../../ffi.mjs", "toArray")
18+
@external(javascript, "../../gleam_javascript_ffi.mjs", "toArray")
1919
pub fn from_list(a: List(element)) -> Array(element)
2020

2121
/// Get the number of elements in the array.
2222
///
2323
/// Runs in constant time.
2424
///
25-
@external(javascript, "../../ffi.mjs", "length")
25+
@external(javascript, "../../gleam_javascript_ffi.mjs", "length")
2626
pub fn size(a: Array(element)) -> Int
2727

2828
/// Returns a new array containing only the elements of the first array after
@@ -37,7 +37,7 @@ pub fn size(a: Array(element)) -> Int
3737
/// from_list([4, 8, 12])
3838
/// ```
3939
///
40-
@external(javascript, "../../ffi.mjs", "map")
40+
@external(javascript, "../../gleam_javascript_ffi.mjs", "map")
4141
pub fn map(a: Array(a), with with: fn(a) -> b) -> Array(b)
4242

4343
/// Reduces a list of elements into a single value by calling a given function
@@ -48,7 +48,7 @@ pub fn map(a: Array(a), with with: fn(a) -> b) -> Array(b)
4848
///
4949
/// Runs in linear time.
5050
///
51-
@external(javascript, "../../ffi.mjs", "reduce")
51+
@external(javascript, "../../gleam_javascript_ffi.mjs", "reduce")
5252
pub fn fold(over over: Array(e), from from: a, with with: fn(a, e) -> a) -> a
5353

5454
/// Reduces a list of elements into a single value by calling a given function
@@ -59,7 +59,7 @@ pub fn fold(over over: Array(e), from from: a, with with: fn(a, e) -> a) -> a
5959
///
6060
/// Runs in linear time.
6161
///
62-
@external(javascript, "../../ffi.mjs", "reduceRight")
62+
@external(javascript, "../../gleam_javascript_ffi.mjs", "reduceRight")
6363
pub fn fold_right(
6464
over over: Array(e),
6565
from from: a,
@@ -80,5 +80,5 @@ pub fn fold_right(
8080
/// Error(Nil)
8181
/// ```
8282
///
83-
@external(javascript, "../../ffi.mjs", "index")
83+
@external(javascript, "../../gleam_javascript_ffi.mjs", "index")
8484
pub fn get(a: Array(e), b: Int) -> Result(e, Nil)

src/gleam/javascript/map.gleam

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ pub type Map(key, value)
1010

1111
/// Create a new `Map` with no contained values.
1212
///
13-
@external(javascript, "../../ffi.mjs", "map_new")
13+
@external(javascript, "../../gleam_javascript_ffi.mjs", "map_new")
1414
pub fn new() -> Map(key, value)
1515

1616
/// Insert a new key and value into the `Map`.
1717
///
1818
/// **NOTE:** This function will mutate the `Map` rather than immutably
1919
/// updating it.
2020
///
21-
@external(javascript, "../../ffi.mjs", "map_set")
21+
@external(javascript, "../../gleam_javascript_ffi.mjs", "map_set")
2222
pub fn set(a: Map(key, value), b: key, c: value) -> Map(key, value)
2323

2424
/// Get the value for a given key in the `Map`.
2525
///
26-
@external(javascript, "../../ffi.mjs", "map_get")
26+
@external(javascript, "../../gleam_javascript_ffi.mjs", "map_get")
2727
pub fn get(a: Map(key, value), b: key) -> Result(value, Nil)
2828

2929
/// Get the number of key-value pairs in the `Map`.
3030
///
31-
@external(javascript, "../../ffi.mjs", "map_size")
31+
@external(javascript, "../../gleam_javascript_ffi.mjs", "map_size")
3232
pub fn size(a: Map(key, value)) -> Int

src/gleam/javascript/promise.gleam

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,34 @@ pub type Promise(value)
2828
/// This function is useful for converting code that uses callbacks into code
2929
/// that uses promises.
3030
///
31-
@external(javascript, "../../ffi.mjs", "newPromise")
31+
@external(javascript, "../../gleam_javascript_ffi.mjs", "newPromise")
3232
pub fn new(a: fn(fn(value) -> Nil) -> Nil) -> Promise(value)
3333

3434
/// Create a promise that resolves immediately.
3535
///
36-
@external(javascript, "../../ffi.mjs", "resolve")
36+
@external(javascript, "../../gleam_javascript_ffi.mjs", "resolve")
3737
pub fn resolve(a: value) -> Promise(value)
3838

3939
/// If the promise is in an error state then apply a function to convert the
4040
/// error value back into valid value, making the promise healthy again.
4141
///
4242
/// This is the equivilent of the `promise.catch` JavaScript method.
4343
///
44-
@external(javascript, "../../ffi.mjs", "rescue")
44+
@external(javascript, "../../gleam_javascript_ffi.mjs", "rescue")
4545
pub fn rescue(a: Promise(value), b: fn(Dynamic) -> value) -> Promise(value)
4646

4747
/// Chain a second asynchronous operation onto a promise, so it runs after the
4848
/// promise has resolved.
4949
///
5050
/// This is the equivilent of the `promise.then` JavaScript method.
5151
///
52-
@external(javascript, "../../ffi.mjs", "then")
52+
@external(javascript, "../../gleam_javascript_ffi.mjs", "then")
5353
pub fn await(a: Promise(a), b: fn(a) -> Promise(b)) -> Promise(b)
5454

5555
/// Run a function on the value a promise resolves to, after it has resolved.
5656
/// The value returned becomes the new value contained by the promise.
5757
///
58-
@external(javascript, "../../ffi.mjs", "map_promise")
58+
@external(javascript, "../../gleam_javascript_ffi.mjs", "map_promise")
5959
pub fn map(a: Promise(a), b: fn(a) -> b) -> Promise(b)
6060

6161
/// Run a function on the value a promise resolves to, after it has resolved.
@@ -116,15 +116,15 @@ pub fn try_await(
116116
///
117117
/// This is the equivilent of the `Promise.all` JavaScript static method.
118118
///
119-
@external(javascript, "../../ffi.mjs", "all_promises")
119+
@external(javascript, "../../gleam_javascript_ffi.mjs", "all_promises")
120120
pub fn await2(a: Promise(a), b: Promise(b)) -> Promise(#(a, b))
121121

122122
/// Chain an asynchronous operation onto 3 promises, so it runs after the
123123
/// promises have resolved.
124124
///
125125
/// This is the equivilent of the `Promise.all` JavaScript static method.
126126
///
127-
@external(javascript, "../../ffi.mjs", "all_promises")
127+
@external(javascript, "../../gleam_javascript_ffi.mjs", "all_promises")
128128
pub fn await3(
129129
a: Promise(a),
130130
b: Promise(b),
@@ -136,7 +136,7 @@ pub fn await3(
136136
///
137137
/// This is the equivilent of the `Promise.all` JavaScript static method.
138138
///
139-
@external(javascript, "../../ffi.mjs", "all_promises")
139+
@external(javascript, "../../gleam_javascript_ffi.mjs", "all_promises")
140140
pub fn await4(
141141
a: Promise(a),
142142
b: Promise(b),
@@ -149,7 +149,7 @@ pub fn await4(
149149
///
150150
/// This is the equivilent of the `Promise.all` JavaScript static method.
151151
///
152-
@external(javascript, "../../ffi.mjs", "all_promises")
152+
@external(javascript, "../../gleam_javascript_ffi.mjs", "all_promises")
153153
pub fn await5(
154154
a: Promise(a),
155155
b: Promise(b),
@@ -163,7 +163,7 @@ pub fn await5(
163163
///
164164
/// This is the equivilent of the `Promise.all` JavaScript static method.
165165
///
166-
@external(javascript, "../../ffi.mjs", "all_promises")
166+
@external(javascript, "../../gleam_javascript_ffi.mjs", "all_promises")
167167
pub fn await6(
168168
a: Promise(a),
169169
b: Promise(b),
@@ -178,7 +178,7 @@ pub fn await6(
178178
///
179179
/// This is the equivilent of the `Promise.all` JavaScript static method.
180180
///
181-
@external(javascript, "../../ffi.mjs", "all_promises")
181+
@external(javascript, "../../gleam_javascript_ffi.mjs", "all_promises")
182182
pub fn await_array(a: Array(Promise(a))) -> Promise(Array(a))
183183

184184
/// 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)) {
192192
|> map(array.to_list)
193193
}
194194

195-
@external(javascript, "../../ffi.mjs", "all_promises")
195+
@external(javascript, "../../gleam_javascript_ffi.mjs", "all_promises")
196196
fn do_await_list(a: List(Promise(a))) -> Promise(Array(a))
197197

198-
@external(javascript, "../../ffi.mjs", "race_promises")
198+
@external(javascript, "../../gleam_javascript_ffi.mjs", "race_promises")
199199
pub fn race2(a: Promise(a), b: Promise(a)) -> Promise(a)
200200

201-
@external(javascript, "../../ffi.mjs", "race_promises")
201+
@external(javascript, "../../gleam_javascript_ffi.mjs", "race_promises")
202202
pub fn race3(a: Promise(a), b: Promise(a), c: Promise(a)) -> Promise(a)
203203

204-
@external(javascript, "../../ffi.mjs", "race_promises")
204+
@external(javascript, "../../gleam_javascript_ffi.mjs", "race_promises")
205205
pub fn race4(
206206
a: Promise(a),
207207
b: Promise(a),
208208
c: Promise(a),
209209
d: Promise(a),
210210
) -> Promise(a)
211211

212-
@external(javascript, "../../ffi.mjs", "race_promises")
212+
@external(javascript, "../../gleam_javascript_ffi.mjs", "race_promises")
213213
pub fn race5(
214214
a: Promise(a),
215215
b: Promise(a),
@@ -218,7 +218,7 @@ pub fn race5(
218218
e: Promise(a),
219219
) -> Promise(a)
220220

221-
@external(javascript, "../../ffi.mjs", "race_promises")
221+
@external(javascript, "../../gleam_javascript_ffi.mjs", "race_promises")
222222
pub fn race6(
223223
a: Promise(a),
224224
b: Promise(a),
@@ -228,8 +228,8 @@ pub fn race6(
228228
f: Promise(a),
229229
) -> Promise(a)
230230

231-
@external(javascript, "../../ffi.mjs", "race_promises")
231+
@external(javascript, "../../gleam_javascript_ffi.mjs", "race_promises")
232232
pub fn race_list(a: List(Promise(a))) -> Promise(a)
233233

234-
@external(javascript, "../../ffi.mjs", "race_promises")
234+
@external(javascript, "../../gleam_javascript_ffi.mjs", "race_promises")
235235
pub fn race_array(a: Array(Promise(a))) -> Promise(a)
File renamed without changes.

0 commit comments

Comments
 (0)