gleam/javascript

Types

Deprecated: The Reference type is being removed from this packge

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

Symbols are special unique values in JavaScript.

For further information view the MDN documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol

pub type Symbol

The variants that type_of can return.

pub type TypeOf {
  UndefinedType
  ObjectType
  BooleanType
  NumberType
  BigIntType
  StringType
  SymbolType
  FunctionType
}

Constructors

  • UndefinedType

    It is the value undefined.

  • ObjectType

    It is some object, or it is null.

  • BooleanType

    It is either true or false.

  • NumberType

    It is some number, a 64 bit float.

  • BigIntType

    It is a JavaScript big-integer.

  • StringType

    It is a string.

  • SymbolType

    It is a JavaScript symbol.

  • FunctionType

    It is a function of unknown argument types and return type.

Functions

pub fn dereference(a: Reference(a)) -> a

Deprecated: The Reference type is being removed from this packge

pub fn get_symbol(a: String) -> Symbol

Use the JavaScript Symbol.for method to look up a symbol with the given string name, creating a new one if one does exist.

For further information see the MDN documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/for

pub fn make_reference(a: a) -> Reference(a)

Deprecated: The Reference type is being removed from this packge

pub fn reference_equal(a: Reference(a), b: Reference(a)) -> Bool

Deprecated: The Reference type is being removed from this packge

pub fn set_reference(a: Reference(a), b: a) -> a

Deprecated: The Reference type is being removed from this packge

pub fn type_of(a: a) -> TypeOf

Determine what category of JavaScript type a value belongs to.

This uses the JavaScript typeof operator and has limited accuracy. It cannot tell you anything about what Gleam type a value has.

For further information view the MDN documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol

pub fn update_reference(ref: Reference(a), f: fn(a) -> a) -> a

Deprecated: The Reference type is being removed from this packge

Search Document