Represents a relationship from one MangaDex object to another such as a manga, author, etc via its id.

Type Parameters

  • T

Hierarchy

Constructors

Properties

cached: boolean = false

Cached relationships are created by using the 'includes' parameter on search requests or other functions that support it. For every type included in the parameter, relationships of that type will be replaced by the actual object. The object will still be represented by a Relationship object, but the resolve method will return instantly with the cached data. Each resulting object will have no further relationships of its own.

cachedData?: object
id: string

The MangaDex UUID of the object this relationship refers to

related?: "monochrome" | "main_story" | "adapted_from" | "based_on" | "prequel" | "side_story" | "doujinshi" | "same_franchise" | "shared_universe" | "sequel" | "spin_off" | "alternate_story" | "alternate_version" | "preserialization" | "colored" | "serialization"

If the relationship is between two manga, how are they related?

type: string

What type of object is this a relationship to

typeMap: Record<string, GettableClass<unknown>> = {}
typeMapLocked: boolean = false

Methods

  • This will automatically fetch the associated object that this relationship refers to. In other words, it wil call Manga.get(id), Chapter.get(id), etc with the information stored in this relationship instance. If this relationship is cached, then the resulting object will not have any relationships of its own.

    Returns Promise<T>

  • Internal

    This function is used to resolved circular references, and should only be used in base.ts. Specifically, it pairs a relationship type to its associated class.

    Parameters

    Returns void

  • This will resolve an array of relationships, returning another array in the same order.

    Type Parameters

    • T

    Parameters

    • relationshipArray: Relationship<T>[]

      An array of relationships of the same type

    Returns Promise<T[]>

Generated using TypeDoc