File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 11import invariant from "invariant" ;
2- import { IMusicMetadataApi , IMusicMetadataBrowserApi } from "./types" ;
2+ import { IMetadataApi } from "./types" ;
33import { IAudioMetadata } from "music-metadata-browser" ; // Import music-metadata type definitions
44import * as Utils from "./utils" ;
55
66type MediaDataType = string | ArrayBuffer | Blob ;
77
88export async function genMediaTags (
99 file : MediaDataType ,
10- musicMetadata : IMusicMetadataBrowserApi | IMusicMetadataApi
10+ musicMetadata : IMetadataApi
1111) : Promise < IAudioMetadata > {
1212 invariant (
1313 file != null ,
Original file line number Diff line number Diff line change @@ -893,9 +893,11 @@ export interface IMusicMetadataApi {
893893 parseBlob ( blob : Blob , options ?: IOptions ) : Promise < IAudioMetadata > ;
894894}
895895
896+ export type IMetadataApi = IMusicMetadataBrowserApi | IMusicMetadataApi ;
897+
896898export interface Extras {
897899 requireJSZip ( ) : Promise < any > ;
898- requireMusicMetadata ( ) : Promise < IMusicMetadataBrowserApi > ;
900+ requireMusicMetadata ( ) : Promise < IMetadataApi > ;
899901 convertPreset : ( ( file : File ) => Promise < Object > ) | null ;
900902 handleTrackDropEvent ?: (
901903 e : React . DragEvent < HTMLDivElement >
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import {
1414 MediaStatus ,
1515 PlaylistTrack ,
1616 PlayerMediaStatus ,
17+ IMetadataApi ,
1718} from "./types" ;
1819import getStore from "./store" ;
1920import App from "./components/App" ;
@@ -52,7 +53,7 @@ export interface PrivateOptions {
5253
5354export interface InjectableDependencies {
5455 requireJSZip : ( ) => Promise < typeof import ( "jszip" ) > ;
55- requireMusicMetadata : ( ) => Promise < typeof import ( "music-metadata" ) > ;
56+ requireMusicMetadata : ( ) => Promise < IMetadataApi > ;
5657}
5758
5859class Webamp {
You can’t perform that action at this time.
0 commit comments