ygleam/awareness

Types

pub type Awareness
pub type AwarenessLocalState =
  List(#(String, y.Value))
pub type AwarenessStates =
  dict.Dict(Float, List(#(String, y.Value)))

Values

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.Option(List(#(String, y.Value)))
pub fn get_states(
  awareness: Awareness,
) -> dict.Dict(Float, List(#(String, y.Value)))
pub fn modify_awareness_update(
  update: BitArray,
  modify: fn(a) -> b,
) -> BitArray
pub fn new(ydoc: y.Doc) -> Awareness
pub fn on_change(
  awareness: Awareness,
  cb: fn(
    List(Int),
    List(Int),
    List(Int),
    option.Option(y.Transaction),
  ) -> Nil,
) -> Nil
pub fn on_update(
  awareness: Awareness,
  cb: fn(
    List(Int),
    List(Int),
    List(Int),
    option.Option(y.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.Option(List(#(String, y.Value))),
) -> Nil
pub fn set_local_state_field(
  awareness: Awareness,
  field: String,
  value: y.Value,
) -> Nil
Search Document