Optionalbackend: GroupMediaBackendAdds a decrypted blob to the cache if it is not already present.
Emits mediaAdded when a new entry is stored. If an entry for the given
key already exists the call is a no-op and no event is emitted.
The key is the hex-encoded SHA-256 of the plaintext.
Hex-encoded SHA-256 of the plaintext blob
The plaintext data and its MIP-04 attachment metadata
Removes all entries from the cache.
Emits cleared.
Retrieves the cached blob for the given plaintext SHA-256 hex key.
Returns null if the entry is not cached.
Hex-encoded SHA-256 of the plaintext blob
Returns true if a cached entry exists for the given key.
Hex-encoded SHA-256 of the plaintext blob
Returns all SHA-256 hex keys currently held in the cache.
Removes the cached entry for the given key.
Emits mediaRemoved if an entry existed.
Hex-encoded SHA-256 of the plaintext blob
Async generator that yields the full list of MediaAttachment
entries whenever the store changes. The current snapshot is emitted
immediately on subscription, then again after every mediaAdded,
mediaRemoved, or cleared event.
The generator runs until the caller breaks out of the loop or the
consuming iterator is garbage-collected (via the finally cleanup).
StaticprefixedOptionalcontext: anyCalls each of the listeners registered for a given event.
Return an array listing the events for which the emitter has registered listeners.
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Optionalfn: (Optionalcontext: anyOptionalonce: booleanAdd a listener for a given event.
Optionalcontext: anyAdd a one-time listener for a given event.
Optionalcontext: anyRemove all listeners, or those of the specified event.
Optionalevent: keyof GroupMediaStoreEventsRemove the listeners of a given event.
Optionalfn: (Optionalcontext: anyOptionalonce: boolean
A group-scoped cache of decrypted StoredMedia entries used by MarmotGroup to avoid redundant MIP-04 key-derivation and decryption on repeated reads of the same media attachment.
The lookup key is the hex-encoded SHA-256 of the plaintext bytes, matching the
sha256/xfield stored in the MIP-04imetatag.Emits events whenever the cache state changes, enabling reactive UIs to update without polling.
If no backend is provided a simple in-memory store is used, giving an ephemeral in-process cache with no disk persistence.