ygleam/awareness

Types

pub type Awareness
pub type AwarenessLocalState =
  List(#(String, BaseType))
pub type AwarenessStates =
  Dict(Float, AwarenessLocalState)

Functions

pub fn apply_awareness_update(
  awareness: Awareness,
  update: BitArray,
  origin: a,
) -> Nil
pub fn destroy(awareness: Awareness) -> Nil
pub fn encode_awareness_update(
  awareness: Awareness,
  clients: List(Int),
) -> BitArray
pub fn get_local_state(
  awareness: Awareness,
) -> Option(List(#(String, BaseType)))
pub fn get_states(
  awareness: Awareness,
) -> Dict(Float, List(#(String, BaseType)))
pub fn modify_awareness_update(
  update: BitArray,
  modify: fn(a) -> b,
) -> BitArray
pub fn new(ydoc: YDoc) -> Awareness
pub fn on_change(
  awareness: Awareness,
  cb: fn(List(Int), List(Int), List(Int), Option(Transaction)) ->
    Nil,
) -> Nil
pub fn on_update(
  awareness: Awareness,
  cb: fn(List(Int), List(Int), List(Int), Option(Transaction)) ->
    Nil,
) -> Nil
pub fn remove_awareness_states(
  awareness: Awareness,
  clients: List(Int),
  origin: a,
) -> Nil
pub fn set_local_state(
  awareness: Awareness,
  state: Option(List(#(String, BaseType))),
) -> Nil
pub fn set_local_state_field(
  awareness: Awareness,
  field: String,
  value: BaseType,
) -> Nil
Search Document