UNPKG

myanimelist-wrapper

Version:

A comprehensive TypeScript wrapper for the Jikan API v4 (unofficial MyAnimeList API)

102 lines (101 loc) 3.78 kB
import type { JikanClient } from "../client"; import type { JikanPaginatedResponse, JikanResponse, User, UserAnimeList, UserAnimeListQueryParams, UserClub, UserFriend, UserHistory, UserMangaList, UserMangaListQueryParams, UserProfile, UserQueryParams, UserRecommendation, UserReview } from "../types"; export declare class UsersEndpoint { private client; constructor(client: JikanClient); /** * Get user by username * @param username Username * @returns Promise with user data */ getByUsername(username: string): Promise<JikanResponse<User>>; /** * Get user profile * @param username Username * @returns Promise with user profile data */ getProfile(username: string): Promise<JikanResponse<UserProfile>>; /** * Get user statistics * @param username Username * @returns Promise with user statistics data */ getStatistics(username: string): Promise<JikanResponse<UserProfile["statistics"]>>; /** * Get user favorites * @param username Username * @returns Promise with user favorites data */ getFavorites(username: string): Promise<JikanResponse<UserProfile["favorites"]>>; /** * Get user updates * @param username Username * @returns Promise with user updates data */ getUpdates(username: string): Promise<JikanResponse<UserProfile["updates"]>>; /** * Get user about * @param username Username * @returns Promise with user about data */ getAbout(username: string): Promise<JikanResponse<string>>; /** * Get user history * @param username Username * @param type History type (anime, manga, all) * @returns Promise with user history data */ getHistory(username: string, type?: "anime" | "manga" | "all"): Promise<JikanResponse<UserHistory[]>>; /** * Get user friends * @param username Username * @param page Page number * @param limit Results per page * @returns Promise with user friends data */ getFriends(username: string, page?: number, limit?: number): Promise<JikanPaginatedResponse<UserFriend>>; /** * Get user reviews * @param username Username * @param page Page number * @param limit Results per page * @returns Promise with user reviews data */ getReviews(username: string, page?: number, limit?: number): Promise<JikanPaginatedResponse<UserReview>>; /** * Get user recommendations * @param username Username * @param page Page number * @param limit Results per page * @returns Promise with user recommendations data */ getRecommendations(username: string, page?: number, limit?: number): Promise<JikanPaginatedResponse<UserRecommendation>>; /** * Get user clubs * @param username Username * @param page Page number * @param limit Results per page * @returns Promise with user clubs data */ getClubs(username: string, page?: number, limit?: number): Promise<JikanPaginatedResponse<UserClub>>; /** * Get user anime list * @param username Username * @param params Query parameters * @returns Promise with user anime list data */ getAnimeList(username: string, params?: UserAnimeListQueryParams): Promise<UserAnimeList>; /** * Get user manga list * @param username Username * @param params Query parameters * @returns Promise with user manga list data */ getMangaList(username: string, params?: UserMangaListQueryParams): Promise<UserMangaList>; /** * Search for users * @param params Search parameters * @returns Promise with user search results */ search(params?: UserQueryParams): Promise<JikanPaginatedResponse<User>>; }