Add types to query keys object

This commit is contained in:
jeffvli 2023-05-20 22:40:22 -07:00
parent 51c2731b07
commit fb158bc069

View File

@ -1,3 +1,4 @@
import { QueryFunctionContext } from '@tanstack/react-query';
import type {
AlbumListQuery,
SongListQuery,
@ -14,7 +15,10 @@ import type {
SongDetailQuery,
} from './types';
export const queryKeys = {
export const queryKeys: Record<
string,
Record<string, (...props: any) => QueryFunctionContext['queryKey']>
> = {
albumArtists: {
detail: (serverId: string, query?: AlbumArtistDetailQuery) => {
if (query) return [serverId, 'albumArtists', 'detail', query] as const;