minca
ApiCoreType aliases

Type Alias: NodeEvent

type NodeEvent = 
  | {
  space: string;
  type: "records";
}
  | {
  space: string;
  type: "status";
}
  | {
  type: "spaces";
}
  | {
  type: "account";
}
  | {
  peer: string;
  reason: string;
  space: string;
  type: "rejected";
}
  | object & LiveMessage
  | {
  space: string;
  type: "revoked";
}
  | {
  type: "network";
};

Defined in: packages/core/src/node/types.ts:437

Union Members

Type Literal

{
  space: string;
  type: "records";
}

Records were added, changed or deleted, locally or by sync


Type Literal

{
  space: string;
  type: "status";
}

Connection or peers changed


Type Literal

{
  type: "spaces";
}

The list of spaces changed: one was created, joined or left, or this account's role or invite in one changed


Type Literal

{
  type: "account";
}

The account's profile may have changed, here or on another device


Type Literal

{
  peer: string;
  reason: string;
  space: string;
  type: "rejected";
}

A peer sent a version that failed validation, and why


object & LiveMessage

A live message from a peer in a space (spaces.send): message is the value sent; from the sender's account, proven by its note, or null for a peer that proved no account: anyone, so treat it as anonymous; peer the sending device's session DID, where a reply to it goes; recordsOnly whether its note writes records but can't define collections here (false for a note that only reads)


Type Literal

{
  space: string;
  type: "revoked";
}

The note this node writes under was revoked in a space. Sent at most once per space.


Type Literal

{
  type: "network";
}

A relay or a connection changed (network.status())

On this page