import { BaseClient } from '@dvcol/base-http-client'; import { TraktApi } from '../api/trakt-api.endpoints.js'; import { TraktAuthentication, TraktClientAuthentication } from '../models/trakt-authentication.model.js'; import { TraktApiTemplate, TraktApiResponse, TraktApiQuery, TraktClientSettings, TraktClientOptions, ITraktApi, TraktApiParams, TraktApiRequest } from '../models/trakt-client.model.js'; import '../models/trakt-stats.model.js'; import '../models/trakt-favorite.model.js'; import '../models/trakt-entity.model.js'; import '@dvcol/common-utils/common/models'; import '../models/trakt-id.model.js'; import '../trakt-list.model-CeURmxQs.js'; import '../models/trakt-episode.model.js'; import '../models/trakt-image.model.js'; import '../models/trakt-people.model.js'; import '../models/trakt-movie.model.js'; import '../models/trakt-season.model.js'; import '../models/trakt-show.model.js'; import '../models/trakt-sync.model.js'; import '../models/trakt-watchlist.model.js'; import '../models/trakt-rating.model.js'; import '../models/trakt-history.model.js'; import '../models/trakt-watched.model.js'; import '../models/trakt-collection.model.js'; import '../models/trakt-progress.model.js'; import '../models/trakt-search.model.js'; import '../api/trakt-api.filters.js'; import '../models/trakt-scrobble.model.js'; import '../models/trakt-note.model.js'; import '../models/trakt-like.model.js'; import '../models/trakt-checkin.model.js'; import '../models/trakt-calendar.model.js'; import '@dvcol/common-utils/http/fetch'; /** * Checks if the fetch response is OK and handles redirects. * * @private * * @param response - The fetch response. * * @returns The same response object if OK. * * @throws Throws the response if not OK. */ declare const isResponseOk: (response: Response) => Response; /** * Parses a Trakt API authentication response to mutate the {@link TraktClientAuthentication} object. * @param response - The response from the Trakt API. * @param auth - The current authentication object. */ declare const parseAuthResponse: (response: T, auth?: TraktClientAuthentication) => TraktClientAuthentication; /** * Parses a Trakt API response to extract {@link TraktClientPagination} and other information. * * @template P - The type of the parameter. * @template R - The type of the response. * * @param {Response} response - The fetch response. * @param {TraktApiTemplate} template - The template for the API endpoint. * * @returns {TraktApiResponse} The parsed Trakt API response. */ declare const parseResponse: (response: Response, template?: TraktApiTemplate

) => TraktApiResponse; /** Needed to type Object assignment */ interface BaseTraktClient extends TraktApi { } /** * Represents a Trakt API client with common functionality. * * @class BaseTraktClient */ declare class BaseTraktClient extends BaseClient implements TraktApi { /** * Creates an instance of BaseTraktClient. * @param options - The options for the client. * @param authentication - The authentication for the client. * @param api - The API endpoints for the client. */ constructor(options: TraktClientOptions, authentication?: TraktClientAuthentication, api?: ITraktApi); /** * Parses the template to construct the headers for a Trakt API request. * * @protected * * @template T - The type of the parameters. * * @param template - The template for the API endpoint. * * @returns {HeadersInit} The parsed request headers. * * @throws {Error} Throws an error if OAuth is required and the access token is missing. */ protected _parseHeaders(template: TraktApiTemplate): HeadersInit; /** * Parses the parameters and constructs the URL for a Trakt API request. * * @protected * * @template T - The type of the parameters. * * @param template - The template for the API endpoint. * @param {T} params - The parameters for the API call. * * @returns {string} The URL for the Trakt API request. * * @throws {Error} Throws an error if mandatory parameters are missing or if a filter is not supported. */ protected _parseUrl(template: TraktApiTemplate, params: T): URL; /** * Parses the response from the API before returning from the call. * @param response - The response from the API. * @param request - The request information. * @param template - The template for the API endpoint. * @returns {TraktApiResponse} The parsed response. * @protected */ protected _parseResponse

(response: Response, request?: TraktApiRequest, template?: TraktApiTemplate

): TraktApiResponse; } export { BaseTraktClient, isResponseOk, parseAuthResponse, parseResponse };