Marmot-TS
    Preparing search index...

    Type Alias GroupsManagerEvents<THistory, TMedia>

    Events emitted by GroupsManager

    type GroupsManagerEvents<
        THistory extends BaseGroupHistory
        | undefined = any,
        TMedia extends BaseGroupMedia | undefined = any,
    > = {
        created: (group: MarmotGroup<THistory, TMedia>) => void;
        destroyed: (groupId: Uint8Array) => void;
        disbanded: (groupId: Uint8Array, evidence: GroupDisbandedEvent) => void;
        imported: (group: MarmotGroup<THistory, TMedia>) => void;
        joined: (group: MarmotGroup<THistory, TMedia>) => void;
        left: (groupId: Uint8Array) => void;
        loaded: (group: MarmotGroup<THistory, TMedia>) => void;
        rejected: (
            groupId: Uint8Array,
            event: NostrEvent,
            reason: RejectReason,
        ) => void;
        removed: (groupId: Uint8Array) => void;
        unloaded: (groupId: Uint8Array) => void;
        unreadable: (groupId: Uint8Array, event: NostrEvent) => void;
        updated: (groups: MarmotGroup<THistory, TMedia>[]) => void;
    }

    Type Parameters

    Index
    created: (group: MarmotGroup<THistory, TMedia>) => void

    Emitted when a new group is created

    destroyed: (groupId: Uint8Array) => void

    Emitted when a group is destroyed

    disbanded: (groupId: Uint8Array, evidence: GroupDisbandedEvent) => void

    Emitted once for the selected, durably recorded terminal commit.

    imported: (group: MarmotGroup<THistory, TMedia>) => void

    Emitted when a group is imported from a ClientState object

    joined: (group: MarmotGroup<THistory, TMedia>) => void

    Emitted when a group is joined

    left: (groupId: Uint8Array) => void

    Emitted when the client leaves a group via self-remove proposal events

    loaded: (group: MarmotGroup<THistory, TMedia>) => void

    Emitted when a group is loaded from the store

    rejected: (groupId: Uint8Array, event: NostrEvent, reason: RejectReason) => void

    Emitted by a GroupsManager.connect subscription when an inbound kind-445 event is rejected at the trust boundary — before it ever reaches group.ingest() — for an invalid signature or a malformed h tag (SEC-01/WIRE-02).

    removed: (groupId: Uint8Array) => void

    Emitted when an inbound commit removed the client from a group — an admin's involuntary Remove, or a peer committing the client's own self_remove. The group's local state is kept as a removedFromGroup tombstone; the app may call GroupsManager.destroy to purge it.

    unloaded: (groupId: Uint8Array) => void

    Emitted when a group is unloaded

    unreadable: (groupId: Uint8Array, event: NostrEvent) => void

    Emitted by a GroupsManager.connect subscription when a received transport event could not be read (e.g. an epoch beyond the retained rewind horizon). Lets the app surface dropped events instead of the connection loop logging them.

    updated: (groups: MarmotGroup<THistory, TMedia>[]) => void

    Emitted when the set of loaded groups changes