Current section
Files
Jump to
Current section
Files
src/gleam@javascript.erl
-module(gleam@javascript).
-compile(no_auto_import).
-export([type_of/1, get_symbol/1, dereference/1, set_reference/2, make_reference/1, update_reference/2]).
-export_type([type_of/0, symbol/0, reference_/1]).
-type type_of() :: undefined_type |
object_type |
boolean_type |
number_type |
big_int_type |
string_type |
symbol_type |
function_type.
-type symbol() :: any().
-type reference_(Value) :: any() | {gleam_phantom, Value}.
-spec type_of(any()) -> type_of().
type_of(Field@0) ->
'../ffi.mjs':type_of(Field@0).
-spec get_symbol(binary()) -> symbol().
get_symbol(Field@0) ->
'../ffi.mjs':get_symbol(Field@0).
-spec dereference(reference_(ETM)) -> ETM.
dereference(Field@0) ->
'../ffi.mjs':dereference(Field@0).
-spec set_reference(reference_(ETO), ETO) -> ETO.
set_reference(Field@0, Field@1) ->
'../ffi.mjs':set_reference(Field@0, Field@1).
-spec make_reference(ETQ) -> reference_(ETQ).
make_reference(Field@0) ->
'../ffi.mjs':make_reference(Field@0).
-spec update_reference(reference_(ETS), fun((ETS) -> ETS)) -> ETS.
update_reference(Ref, F) ->
Value = '../ffi.mjs':dereference(Ref),
'../ffi.mjs':set_reference(Ref, F(Value)),
Value.