fix: typed networkManager.fetch

This commit is contained in:
JellyBrick
2025-08-02 16:49:15 +09:00
parent 5e4a1253d4
commit 62b40d4df5
4 changed files with 25 additions and 6 deletions

View File

@ -19,8 +19,14 @@ export const getMusicQueueRenderer = async (
const store = queue?.queue.store.store;
if (!store) return null;
return (await app.networkManager.fetch('/music/get_queue', {
return await app.networkManager.fetch<
QueueRendererResponse,
{
queueContextParams: string;
videoIds: string[];
}
>('/music/get_queue', {
queueContextParams: store.getState().queue.queueContextParams,
videoIds,
})) as QueueRendererResponse | null;
});
};

View File

@ -111,9 +111,14 @@ export class YTMusic implements LyricProvider {
if (!app) return null;
return app.networkManager.fetch('/next?prettyPrint=false', {
return app.networkManager.fetch<
NextData,
{
videoId: string;
}
>('/next?prettyPrint=false', {
videoId,
}) as Promise<NextData>;
});
}
private fetchBrowse(browseId: string) {