@waveform-playlist/browser 7.1.1 → 7.1.2

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.
package/dist/index.d.ts CHANGED
@@ -1374,12 +1374,26 @@ export declare interface TrackEffectsState {
1374
1374
  activeEffects: TrackActiveEffect[];
1375
1375
  }
1376
1376
 
1377
+ /** Info about a track that failed to load. */
1378
+ export declare interface TrackLoadError {
1379
+ /** Display name of the source that failed. */
1380
+ name: string;
1381
+ /** The underlying error. */
1382
+ error: Error;
1383
+ }
1384
+
1377
1385
  declare interface TrackMenuItem {
1378
1386
  id: string;
1379
1387
  label?: string;
1380
1388
  content: ReactNode;
1381
1389
  }
1382
1390
 
1391
+ /** A source that can be decoded into a track. */
1392
+ export declare type TrackSource = File | Blob | string | {
1393
+ src: string;
1394
+ name?: string;
1395
+ };
1396
+
1383
1397
  /** Per-track overrides for spectrogram rendering (render mode, config, color map) */
1384
1398
  declare interface TrackSpectrogramOverrides {
1385
1399
  renderMode: RenderMode;
@@ -1710,6 +1724,26 @@ export declare interface UseDynamicEffectsReturn {
1710
1724
  analyserRef: React.RefObject<Analyser | null>;
1711
1725
  }
1712
1726
 
1727
+ export declare function useDynamicTracks(): UseDynamicTracksReturn;
1728
+
1729
+ export declare interface UseDynamicTracksReturn {
1730
+ /**
1731
+ * Current tracks array (placeholders + loaded). Pass to WaveformPlaylistProvider.
1732
+ * Placeholder tracks have `clips: []` and names ending with " (loading...)".
1733
+ */
1734
+ tracks: ClipTrack[];
1735
+ /** Add one or more sources — creates placeholder tracks immediately. */
1736
+ addTracks: (sources: TrackSource[]) => void;
1737
+ /** Remove a track by its id. Aborts in-flight fetch/decode if still loading. */
1738
+ removeTrack: (trackId: string) => void;
1739
+ /** Number of sources currently decoding. */
1740
+ loadingCount: number;
1741
+ /** True when any source is still decoding. */
1742
+ isLoading: boolean;
1743
+ /** Tracks that failed to load (removed from `tracks` automatically). */
1744
+ errors: TrackLoadError[];
1745
+ }
1746
+
1713
1747
  /**
1714
1748
  * Hook for exporting the waveform playlist to WAV format
1715
1749
  * Uses OfflineAudioContext for fast, non-real-time rendering