Skip to Content
Mika Scraper 1.1.1 is released πŸŽ‰
🍩 MIKA TYPE ALIASPage

Type Alias: AnimeFinderResponse

AnimeFinderResponse = AnimeFinderResult | AnimeFinderError

Defined in

src/anime-finder/anime-finder.ts:40

Overview

The AnimeFinderResponse type alias represents the structured response returned by the AnimeFinder API. It can either be a successful result containing information about the found anime or an error indicating the failure of the request.

Usage

When interacting with the AnimeFinder API, developers should utilize the AnimeFinderResponse type to handle the responses effectively, ensuring they can differentiate between successful results and errors.

Type Structure

This type alias includes two potential structures:

  1. AnimeFinderResult: Represents a successful response containing information about the anime found.
  2. AnimeFinderError: Represents an error response which provides details about the issue encountered during the API call.

Example

Here’s how you might use the AnimeFinderResponse type in a TypeScript function:

import { AnimeFinderResponse } from './path/to/type-definitions'; function handleResponse(response: AnimeFinderResponse) { if ('error' in response) { console.error('Error:', response.error); } else { console.log('Anime Found:', response.title); } }

Notes

  • Ensure proper error handling when working with AnimeFinderResponse to maintain robust application behavior.
  • Refer to the individual interfaces AnimeFinderResult and AnimeFinderError for detailed structure definitions.
Last updated on