docs: add JSDoc to onSessionTranscriptUpdate

This commit is contained in:
SciFantastic
2026-02-17 09:11:35 -06:00
committed by Peter Steinberger
parent 53ada1e9b9
commit 2365c6c86a

View File

@@ -6,6 +6,11 @@ type SessionTranscriptListener = (update: SessionTranscriptUpdate) => void;
const SESSION_TRANSCRIPT_LISTENERS = new Set<SessionTranscriptListener>();
/**
* Register a listener for session transcript updates.
* Returns an unsubscribe function. Listeners are guarded with try/catch
* so a throwing subscriber cannot prevent other listeners from firing.
*/
export function onSessionTranscriptUpdate(listener: SessionTranscriptListener): () => void {
SESSION_TRANSCRIPT_LISTENERS.add(listener);
return () => {