chore: upgrade tooling stack
- TypeScript 3.9 -> 5.8 - ESLint 6 -> 9 (flat config) - Prettier 1 -> 3 - eslint-plugin-vue 6 -> 9 - Add vue-tsc for type checking - Migrate Sass @import to @use syntax - Fix Pinia persistence config for v4 - Add Spotify type declarations - Remove unused registerServiceWorker.ts
This commit is contained in:
42
src/types/spotify.d.ts
vendored
Normal file
42
src/types/spotify.d.ts
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
declare global {
|
||||
interface SpotifyPlayer {
|
||||
connect(): Promise<boolean>
|
||||
disconnect(): void
|
||||
addListener(event: string, callback: (data: unknown) => void): void
|
||||
removeListener(event: string, callback?: (data: unknown) => void): void
|
||||
getCurrentState(): Promise<SpotifyPlayerState | null>
|
||||
resume(): Promise<void>
|
||||
pause(): Promise<void>
|
||||
togglePlay(): Promise<void>
|
||||
seek(position_ms: number): Promise<void>
|
||||
previousTrack(): Promise<void>
|
||||
nextTrack(): Promise<void>
|
||||
}
|
||||
|
||||
interface SpotifyPlayerState {
|
||||
paused: boolean
|
||||
track_window?: {
|
||||
current_track?: {
|
||||
name: string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface SpotifyPlayerConstructorOptions {
|
||||
name: string
|
||||
getOAuthToken: (callback: (token: string) => void) => void
|
||||
}
|
||||
|
||||
interface SpotifyNamespace {
|
||||
Player: new (options: SpotifyPlayerConstructorOptions) => SpotifyPlayer
|
||||
}
|
||||
|
||||
interface Window {
|
||||
onSpotifyWebPlaybackSDKReady?: () => void
|
||||
Spotify: SpotifyNamespace
|
||||
}
|
||||
|
||||
const Spotify: SpotifyNamespace
|
||||
}
|
||||
|
||||
export {}
|
||||
Reference in New Issue
Block a user