blob: ade2c54d0106342f40e0c8b374c87ce1ddf359a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import gleam/io
// A type with no Gleam constructors
pub type DateTime
// An external function that creates an instance of the type
@external(javascript, "./my_package_ffi.mjs", "now")
pub fn now() -> DateTime
// The `now` function in `./my_package_ffi.mjs` looks like this:
// external function now() {
// return new Date();
// }
pub fn main() {
io.debug(now())
}
|