AniLink - v3.0.0
    Preparing search index...

    Interface MyAnimeListMangaApi

    MyAnimeListMangaApi is the manga group exposed by MyAnimeListApi under aniLink.mal.manga.

    It is the facade boundary for MyAnimeList manga reads and list-status writes. get delegates to MalMangaOperation and returns a MalManga shaped by MalRequestOptions.fields. updateMyListStatus and deleteFromList cover the authenticated PATCH and DELETE /manga/{id}/my_list_status endpoints.

    interface MyAnimeListMangaApi {
        deleteFromList: (
            params: MalMangaDeleteParams,
            options?: MalRequestOptions,
        ) => Promise<void>;
        get: (
            params: MalMangaGetParams,
            options?: MalRequestOptions,
        ) => Promise<MalManga>;
        ranking: (
            params: MalMangaRankingParams,
            options?: MalRequestOptions,
        ) => Promise<MalMangaRankingResponse>;
        search: (
            params: MalMangaSearchParams,
            options?: MalRequestOptions,
        ) => Promise<MalMangaSearchResponse>;
        updateMyListStatus: (
            params: MalMangaListStatusUpdateParams,
            options?: MalRequestOptions,
        ) => Promise<MalMangaListStatus>;
    }
    Index
    deleteFromList: (
        params: MalMangaDeleteParams,
        options?: MalRequestOptions,
    ) => Promise<void>

    MyAnimeListMangaApi.deleteFromList removes a manga from the authenticated user's list through MalMangaOperation.deleteFromList.

    It is the public facade for DELETE /manga/{id}/my_list_status and requires a MAL access token from MalCredentials.accessToken via buildMyAnimeListApi.

    Type Declaration

    AniLinkAuthError when no MAL access token is configured.

    AniLinkRestError for a non-success MyAnimeList response.

    AniLinkNetworkError for timeout, cancellation, or other transport failures.

    const api = new AniLink({ mal: { accessToken: "mal-token" } }).mal;
    await api.manga.deleteFromList({ id: 1 });
    get: (
        params: MalMangaGetParams,
        options?: MalRequestOptions,
    ) => Promise<MalManga>

    MyAnimeListMangaApi.get gets one manga by its MyAnimeList ID through MalMangaOperation.get.

    It is the public facade for the GET /manga/{id} endpoint; use MalRequestOptions.fields to select the response shape and MalRequestOptions transport settings to override per call.

    Type Declaration

    AniLinkRestError for a non-success MyAnimeList response.

    AniLinkNetworkError for timeout, cancellation, or other transport failures.

    const api = new AniLink({ mal: { accessToken: "mal-token" } }).mal;
    const manga = await api.manga.get({ id: 1 }, { fields: ["id", "title", "main_picture"] });
    ranking: (
        params: MalMangaRankingParams,
        options?: MalRequestOptions,
    ) => Promise<MalMangaRankingResponse>

    MyAnimeListMangaApi.ranking gets one of MyAnimeList's manga ranking lists through MalMangaOperation.ranking.

    It is the public facade for GET /manga/ranking; use MalRequestOptions.fields to select the response shape and MalRequestOptions transport settings to override per call.

    Type Declaration

    AniLinkRestError for a non-success MyAnimeList response.

    AniLinkNetworkError for timeout, cancellation, or other transport failures.

    const api = new AniLink({ mal: { accessToken: "mal-token" } }).mal;
    const top = await api.manga.ranking(
    { rankingType: "manga" },
    { fields: ["id", "title", "mean"] }
    );
    console.log(top.data[0]?.node.title, top.data[0]?.ranking.rank);
    search: (
        params: MalMangaSearchParams,
        options?: MalRequestOptions,
    ) => Promise<MalMangaSearchResponse>

    MyAnimeListMangaApi.search searches MyAnimeList manga by keyword through MalMangaOperation.search.

    It is the public facade for GET /manga; use MalRequestOptions.fields to select the response shape and MalRequestOptions transport settings to override per call.

    Type Declaration

    AniLinkValidationError when q is empty or only whitespace.

    AniLinkRestError for a non-success MyAnimeList response.

    AniLinkNetworkError for timeout, cancellation, or other transport failures.

    const api = new AniLink({ mal: { accessToken: "mal-token" } }).mal;
    const results = await api.manga.search(
    { q: "berserk" },
    { fields: ["id", "title", "main_picture"] }
    );
    console.log(results.data[0]?.node.title);
    updateMyListStatus: (
        params: MalMangaListStatusUpdateParams,
        options?: MalRequestOptions,
    ) => Promise<MalMangaListStatus>

    MyAnimeListMangaApi.updateMyListStatus updates the authenticated user's manga list status through MalMangaOperation.updateMyListStatus.

    It is the public facade for PATCH /manga/{id}/my_list_status and requires a MAL access token from MalCredentials.accessToken via buildMyAnimeListApi; send only the MalMangaListStatusUpdate fields you want to change, form-encoded as MAL requires.

    Type Declaration

    AniLinkAuthError when no MAL access token is configured.

    AniLinkValidationError when params carries no known list-status field to change.

    AniLinkRestError for a non-success MyAnimeList response.

    AniLinkNetworkError for timeout, cancellation, or other transport failures.

    const api = new AniLink({ mal: { accessToken: "mal-token" } }).mal;
    const status = await api.manga.updateMyListStatus({
    id: 1,
    status: "reading",
    num_chapters_read: 10,
    score: 9,
    });