import { TraktApiCommonFilters } from '../api/trakt-api.filters.cjs'; import { TraktApiParams, TraktApiExtended, TraktApiParamsExtended, TraktApiParamsPagination } from './trakt-client.model.cjs'; import { Any, EntityTypes, Short } from './trakt-entity.model.cjs'; import { TraktEpisode } from './trakt-episode.model.cjs'; import { d as TraktList } from '../trakt-list.model-DUX3arQu.cjs'; import { TraktMovie } from './trakt-movie.model.cjs'; import { TraktPerson } from './trakt-people.model.cjs'; import { TraktShow } from './trakt-show.model.cjs'; import '@dvcol/common-utils/common/models'; import '@dvcol/base-http-client'; import '@dvcol/common-utils/http/fetch'; import './trakt-id.model.cjs'; import './trakt-image.model.cjs'; import './trakt-season.model.cjs'; type TraktSearchField = { movie: 'title' | 'overview' | 'aliases' | 'people' | 'translations' | 'tagline'; show: 'title' | 'overview' | 'aliases' | 'people' | 'translations'; episode: 'title' | 'overview'; person: 'name' | 'biography'; list: 'name' | 'description'; }; type TraktSearchType = keyof TraktSearchField; /** * Trakt Search request * @see search [Trakt API Documentation](https://trakt.docs.apiary.io/#reference/search) */ type TraktSearch = TraktApiParams<{ /** Search type */ type: T | T[]; /** Search all text based fields. */ query: string; /** Filter search on (a) specific field(s) */ fields?: TraktSearchField[T] | TraktSearchField[T][]; /** Escape special characters in the query string. */ escape?: boolean; }, typeof TraktApiExtended.Full, TraktApiCommonFilters, true>; type BaseTraktSearchResultItem = { movie: TraktMovie; show: TraktShow; episode: TraktEpisode; person: TraktPerson; list: TraktList; }; /** * Search all text fields that a media object contains (i.e. title, overview, etc). * Results are ordered by the most relevant score. * Specify the type of results by sending a single value or a comma delimited string for multiple types. * * @see [search]{@link https://trakt.docs.apiary.io/#reference/search} */ type TraktSearchResult = { score: number; type: T extends Any ? 'movie' | 'show' | 'episode' | 'person' | 'list' : T; } & (T extends 'movie' ? Pick, 'movie'> : T extends 'show' ? Pick, 'show'> : T extends 'episode' ? Pick, 'show' | 'episode'> : T extends 'person' ? Pick, 'person'> : T extends 'list' ? Pick, 'list'> : Partial>); type TraktIdLookupType = 'trakt' | 'imdb' | 'tmdb' | 'tvdb'; type TraktIdLookup = { id_type: TraktIdLookupType; id: string; type?: TraktSearchType | TraktSearchType[]; } & TraktApiParamsExtended & TraktApiParamsPagination; export type { TraktIdLookup, TraktIdLookupType, TraktSearch, TraktSearchField, TraktSearchResult, TraktSearchType };