interview-widget 3.1.5 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,8 +37,10 @@ declare class STTService {
37
37
  private config;
38
38
  private mediaRecorder;
39
39
  private audioChunks;
40
+ private audioChunksTotalSize;
40
41
  private recordingStream;
41
42
  private autoStopTimeoutId;
43
+ private disposed;
42
44
  constructor(config?: STTConfig);
43
45
  /**
44
46
  * Update STT configuration
@@ -49,11 +51,21 @@ declare class STTService {
49
51
  */
50
52
  isRecordingSupported(): boolean;
51
53
  /**
52
- * Start recording audio from user's microphone
54
+ * Start recording audio from user's microphone.
55
+ *
56
+ * Event flow:
57
+ * - onStart fires immediately when recording begins
58
+ * - onStop fires ONLY via the MediaRecorder's stop event (single source of truth)
59
+ * - onError fires on MediaRecorder errors
60
+ * - onDataAvailable fires every 100ms with new audio data
53
61
  */
54
62
  startRecording(maxDuration?: number, events?: RecordingEvents): Promise<void>;
55
63
  /**
56
- * Stop recording and return the audio blob
64
+ * Stop recording and return the audio blob.
65
+ *
66
+ * NOTE: This method does NOT fire onStop — that is handled exclusively
67
+ * by the MediaRecorder's "stop" event listener set in startRecording().
68
+ * This prevents the double-fire issue.
57
69
  */
58
70
  stopRecording(): Promise<Blob>;
59
71
  /**
@@ -68,6 +80,15 @@ declare class STTService {
68
80
  * Check if currently recording
69
81
  */
70
82
  isRecording(): boolean;
83
+ /**
84
+ * Fully dispose of the service instance, releasing all resources.
85
+ * After calling dispose(), the instance cannot be reused.
86
+ */
87
+ dispose(): void;
88
+ /**
89
+ * Check if the service has been disposed
90
+ */
91
+ isDisposed(): boolean;
71
92
  /**
72
93
  * Get supported MIME type for recording
73
94
  */
@@ -80,6 +101,10 @@ declare class STTService {
80
101
  * Clean up recording resources
81
102
  */
82
103
  private cleanup;
104
+ /**
105
+ * Throw if the service has been disposed
106
+ */
107
+ private throwIfDisposed;
83
108
  }
84
109
  export declare const sttService: STTService;
85
110
  export { STTService };