import { Short, Any } from './trakt-entity.model.cjs'; import { TraktEpisode } from './trakt-episode.model.cjs'; import { TraktMovie } from './trakt-movie.model.cjs'; import { TraktShow } from './trakt-show.model.cjs'; import '@dvcol/common-utils/common/models'; import './trakt-client.model.cjs'; import '@dvcol/base-http-client'; import '@dvcol/common-utils/http/fetch'; import '../api/trakt-api.filters.cjs'; import './trakt-id.model.cjs'; import './trakt-image.model.cjs'; import './trakt-people.model.cjs'; type TraktWatchedEpisode = { number: number; plays: number; /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ last_watched_at: string; }; type TraktWatchedSeason = { number: number; episodes: TraktWatchedEpisode[]; }; type TraktWatchedShow = N extends 'no-seasons' ? { show: TraktShow; } : { show: TraktShow; seasons: TraktWatchedSeason[]; }; type BaseTraktWatched = { plays: number; /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ last_watched_at: string; /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ last_updated_at: string; /** Timestamp in ISO 8601 GMT format (YYYY-MM-DD'T'hh:mm:ss.sssZ) */ reset_at?: string; }; type TraktWatched = BaseTraktWatched & (T extends 'movie' ? { movie: TraktMovie; } : T extends 'show' ? TraktWatchedShow : { movie: TraktMovie; } | TraktWatchedShow); type TraktWatching = { expires_at: string; started_at: string; action: 'scrobble' | 'checkin'; type: T extends Any ? 'movie' | 'episode' : T; } & (T extends 'movie' ? { movie: TraktMovie; } : T extends 'episode' ? { episode: TraktEpisode; show: TraktShow; } : { movie: TraktMovie; } | { episode: TraktEpisode; show: TraktShow; }); export type { TraktWatched, TraktWatchedEpisode, TraktWatchedSeason, TraktWatchedShow, TraktWatching };