mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-12 19:01:47 +00:00
fix: fix bugs in MPRIS, and improve MPRIS (#1760)
Co-authored-by: JellyBrick <shlee1503@naver.com> Co-authored-by: Totto <32566573+Totto16@users.noreply.github.com>
This commit is contained in:
40
src/types/queue.ts
Normal file
40
src/types/queue.ts
Normal file
@ -0,0 +1,40 @@
|
||||
import type { YoutubePlayer } from '@/types/youtube-player';
|
||||
import type { GetState, QueueItem } from '@/types/datahost-get-state';
|
||||
|
||||
type StoreState = GetState;
|
||||
type Store = {
|
||||
dispatch: (obj: {
|
||||
type: string;
|
||||
payload?: {
|
||||
items?: QueueItem[];
|
||||
};
|
||||
}) => void;
|
||||
|
||||
getState: () => StoreState;
|
||||
replaceReducer: (param1: unknown) => unknown;
|
||||
subscribe: (callback: () => void) => unknown;
|
||||
}
|
||||
|
||||
export type QueueElement = HTMLElement & {
|
||||
dispatch(obj: {
|
||||
type: string;
|
||||
payload?: unknown;
|
||||
}): void;
|
||||
queue: QueueAPI;
|
||||
};
|
||||
export type QueueAPI = {
|
||||
getItems(): QueueItem[];
|
||||
store: {
|
||||
store: Store,
|
||||
};
|
||||
continuation?: string;
|
||||
autoPlaying?: boolean;
|
||||
};
|
||||
export type AppElement = HTMLElement & AppAPI;
|
||||
export type AppAPI = {
|
||||
queue_: QueueAPI;
|
||||
playerApi_: YoutubePlayer;
|
||||
openToast: (message: string) => void;
|
||||
|
||||
// TODO: Add more
|
||||
};
|
||||
Reference in New Issue
Block a user