@behindthemusictree/app-kit 35.0.0 → 37.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { QueryKey, InfiniteData } from '@tanstack/react-query';
3
3
  import * as zod from 'zod';
4
4
  import { z } from 'zod';
5
- import { S as Scope } from '../scope-BoMVOHmz.js';
5
+ import { S as Scope, u as useFetchWrapper } from '../useFetchWrapper-C5lt5fQz.js';
6
6
  import { b as GenreUuid, G as GenrePlaylistUuid } from '../ids-D8XCErUS.js';
7
7
  export { a as GenrePlaylistUuidSchema, c as GenreUuidSchema } from '../ids-D8XCErUS.js';
8
8
  import * as react from 'react';
@@ -3907,6 +3907,8 @@ interface UseRemoteSearchOptions<TSchema extends z.ZodTypeAny> {
3907
3907
  * makes old results wrong for the new query (e.g. the playback key); omit it to always keep them.
3908
3908
  */
3909
3909
  scope?: string;
3910
+ /** Replaces the plain fetch, e.g. `usePlaybackFetch`'s `fetchBound` for country-dependent endpoints. */
3911
+ fetch?: ReturnType<typeof useFetchWrapper>["fetch"];
3910
3912
  }
3911
3913
  interface UseRemoteSearchResult<T> {
3912
3914
  results: T[];
@@ -3917,7 +3919,7 @@ interface UseRemoteSearchResult<T> {
3917
3919
  pending: boolean;
3918
3920
  }
3919
3921
  /** Debounced typeahead against a search endpoint; the shared core of the artist, song and genre searches. */
3920
- declare function useRemoteSearch<TSchema extends z.ZodType<unknown[]>>(getBackendBaseUrl: () => string, { queryKey, endpoint, params, schema, context, text, enabled: extraEnabled, scope }: UseRemoteSearchOptions<TSchema>): UseRemoteSearchResult<z.infer<TSchema>[number]>;
3922
+ declare function useRemoteSearch<TSchema extends z.ZodType<unknown[]>>(getBackendBaseUrl: () => string, { queryKey, endpoint, params, schema, context, text, enabled: extraEnabled, scope, fetch: fetchOverride }: UseRemoteSearchOptions<TSchema>): UseRemoteSearchResult<z.infer<TSchema>[number]>;
3921
3923
 
3922
3924
  interface UseSearchQueryStateOptions {
3923
3925
  /** Name of the currently selected item; fills the query whenever it changes. */
@@ -3969,6 +3971,9 @@ interface UseGenreTreeViewStateOptions<O extends CriteriaOverview = CriteriaOver
3969
3971
  }
3970
3972
  interface UseGenreTreeViewStateResult {
3971
3973
  isLoading: boolean;
3974
+ /** The tree failed to load and nothing is cached. `genrePlaylists` is empty, which is not "no genres". */
3975
+ isError: boolean;
3976
+ refetch: () => void;
3972
3977
  /** True while the visible tree is being refreshed or re-pruned; the previous tree stays in `genrePlaylists`. */
3973
3978
  isFetching: boolean;
3974
3979
  genrePlaylists: CriteriaPlaylistSimple[];
@@ -4016,6 +4021,50 @@ interface UseVisibleGenrePlaylistsOptions {
4016
4021
  */
4017
4022
  declare function useVisibleGenrePlaylists({ scope, getBackendBaseUrl, artistUuid }: UseVisibleGenrePlaylistsOptions): {
4018
4023
  isLoading: boolean;
4024
+ isError: boolean;
4025
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<NoInfer<{
4026
+ uuid: string & zod.$brand<"GenrePlaylistUuid">;
4027
+ name: string;
4028
+ createdOn: string;
4029
+ updatedOn: string | null;
4030
+ root: {
4031
+ uuid: string & zod.$brand<"GenrePlaylistUuid">;
4032
+ name: string;
4033
+ };
4034
+ parent: {
4035
+ uuid: string & zod.$brand<"GenrePlaylistUuid">;
4036
+ name: string;
4037
+ } | null;
4038
+ tracksCount: number;
4039
+ criteria: {
4040
+ uuid: string & zod.$brand<"GenreUuid">;
4041
+ name: string;
4042
+ side?: "pop" | "core" | null | undefined;
4043
+ wikidataId?: string | null | undefined;
4044
+ } | null;
4045
+ isUnacceptedRoot: boolean;
4046
+ genreOnlyTracksCount?: number | undefined;
4047
+ genreAndSubgenresTracksCount?: {
4048
+ canonical: number;
4049
+ regional: number;
4050
+ all: number;
4051
+ } | {
4052
+ all: number;
4053
+ } | undefined;
4054
+ catalogue?: ({
4055
+ genreOnlyTracksCount: number;
4056
+ genreAndSubgenresTracksCount: {
4057
+ canonical: number;
4058
+ regional: number;
4059
+ all: number;
4060
+ } | {
4061
+ all: number;
4062
+ };
4063
+ } & zod.$brand<"GenreCatalogueCounts">) | undefined;
4064
+ viewsCount?: number | undefined;
4065
+ isUmbrella?: boolean | undefined;
4066
+ scene?: "commercial" | "underground" | null | undefined;
4067
+ }[]>, Error>>;
4019
4068
  isFetching: boolean;
4020
4069
  genrePlaylists: {
4021
4070
  uuid: string & zod.$brand<"GenrePlaylistUuid">;
@@ -124,8 +124,8 @@ import {
124
124
  useTrackListSidebarVisibility,
125
125
  useUpdateGenre,
126
126
  useVisibleGenrePlaylists
127
- } from "../chunk-ULSVAC23.js";
128
- import "../chunk-4TE4OSOM.js";
127
+ } from "../chunk-XIJPC7D5.js";
128
+ import "../chunk-7S6EALIP.js";
129
129
  import "../chunk-T5D5T52J.js";
130
130
  import "../chunk-4MEK3CNF.js";
131
131
  import "../chunk-MAKY4YBN.js";