@wwdrew/expo-spotify-sdk
Version:
Expo module wrapping the native Spotify iOS (v5) and Android (v4) SDKs for OAuth authentication and App Remote playback control
36 lines • 1.25 kB
TypeScript
import type { ContentItem } from "../content";
import type { Track } from "../player";
export type { ImagesErrorCode } from "./error";
export { ImagesError } from "./error";
export type ImageSize = "small" | "medium" | "large";
export interface ImageResult {
uri: string;
}
/** Minimal shape required to fetch an image by identifier. */
interface HasImageIdentifier {
imageIdentifier?: string | null;
}
/** Minimal album/artist representation for image loading. */
interface BasicImageEntity {
imageIdentifier?: string | null;
}
export type ImageRepresentable = Track | ContentItem | BasicImageEntity | HasImageIdentifier;
/**
* Spotify Images namespace. Fetches cover art for tracks, albums, artists,
* and content items via the App Remote SDK, writing the bitmap to a temp file
* and returning its local URI. Requires `AppRemote.connect()` to be resolved.
*
* @example
* ```ts
* import { Images } from "@wwdrew/expo-spotify-sdk";
*
* const { uri } = await Images.load(track, "large");
* ```
*/
export declare const Images: {
/**
* Loads a Spotify image and returns a local file URI.
*/
readonly load: (item: ImageRepresentable, size: ImageSize) => Promise<ImageResult>;
};
//# sourceMappingURL=index.d.ts.map