myanimelist-wrapper
Version:
A comprehensive TypeScript wrapper for the Jikan API v4 (unofficial MyAnimeList API)
56 lines (55 loc) • 1.97 kB
TypeScript
import { AnimeEndpoint } from "./endpoints/anime";
import { MangaEndpoint } from "./endpoints/manga";
import { CharactersEndpoint } from "./endpoints/characters";
import { PeopleEndpoint } from "./endpoints/people";
import { ClubsEndpoint } from "./endpoints/clubs";
import { SeasonsEndpoint } from "./endpoints/seasons";
import { SchedulesEndpoint } from "./endpoints/schedules";
import { TopEndpoint } from "./endpoints/top";
import { GenresEndpoint } from "./endpoints/genres";
import { ProducersEndpoint } from "./endpoints/producers";
import { MagazinesEndpoint } from "./endpoints/magazines";
import { UsersEndpoint } from "./endpoints/users";
import { ReviewsEndpoint } from "./endpoints/reviews";
import { RecommendationsEndpoint } from "./endpoints/recommendations";
import { RandomEndpoint } from "./endpoints/random";
export interface JikanClientOptions {
baseUrl?: string;
timeout?: number;
headers?: Record<string, string>;
}
/**
* Main client for interacting with the Jikan API
*/
export declare class JikanClient {
private baseUrl;
private timeout;
private headers;
anime: AnimeEndpoint;
manga: MangaEndpoint;
characters: CharactersEndpoint;
people: PeopleEndpoint;
clubs: ClubsEndpoint;
seasons: SeasonsEndpoint;
schedules: SchedulesEndpoint;
top: TopEndpoint;
genres: GenresEndpoint;
producers: ProducersEndpoint;
magazines: MagazinesEndpoint;
users: UsersEndpoint;
reviews: ReviewsEndpoint;
recommendations: RecommendationsEndpoint;
random: RandomEndpoint;
/**
* Create a new JikanClient instance
* @param options Client configuration options
*/
constructor(options?: JikanClientOptions);
/**
* Make a request to the Jikan API
* @param endpoint API endpoint path
* @param params Query parameters
* @returns Promise with the API response
*/
request<T>(endpoint: string, params?: Record<string, any>): Promise<T>;
}