feat: working types

This commit is contained in:
janishutz committed 2026-08-29 15:29:04 +02:00
1 parent 95338f676e
commit bba6fd185e
6 files changed
+178 -170

No files matched your search

+37 -34
View File
@@ -1,47 +1,50 @@
/* eslint-disable @typescript-eslint/triple-slash-reference */
/// <reference path="MusicKitInstance.d.ts" />
/// <reference path="enums.d.ts" />
/// <reference path="MusicKitAPI.d.ts" />
import {
Artwork,
PlaybackBitrate
} from './enums';
import {
MusicKitInstance
} from './MusicKitInstance';
declare namespace MusicKit {
export interface MusicKitConfiguration {
export interface MusicKitConfiguration {
/**
* See https://js-cdn.music.apple.com/musickit/v3/docs/iframe.html?path=/story/get-started--page#configuring-musickit-on-the-web
*/
'developerToken': string;
/**
* Your application configuration
*/
'app': {
/**
* See https://js-cdn.music.apple.com/musickit/v3/docs/iframe.html?path=/story/get-started--page#configuring-musickit-on-the-web
* The name of your application
*/
'developerToken': string;
'name': string;
/**
* Your application configuration
* Build or version number of application
*/
'app': {
/**
* The name of your application
*/
'name': string;
/**
* Build or version number of application
*/
'build'?: string;
/**
* A URL to your application logo. Should be square at 152x152px
*/
'icon'?: string;
};
'bitrate'?: PlaybackBitrate;
'build'?: string;
/**
* Set the storefront, which is set for the API requests.
* If unset, then the authenticated user's storefrontId will be used.
* A URL to your application logo. Should be square at 152x152px
*/
'storefrontId'?: string;
}
'icon'?: string;
};
export function configure ( config: MusicKitConfiguration ): Promise<MusicKitInstance>;
'bitrate'?: PlaybackBitrate;
export function getInstance (): MusicKitInstance;
/**
* Set the storefront, which is set for the API requests.
* If unset, then the authenticated user's storefrontId will be used.
*/
'storefrontId'?: string;
}
export function formatArtworkURL ( artwork: Artwork, width: number, height: number ): string;
export interface MusicKitObject {
'configure': ( config: MusicKitConfiguration ) => Promise<MusicKitInstance>;
'getInstance': () => MusicKitInstance;
'formatArtworkURL': ( artwork: Artwork, width: number, height: number ) => string;
}