mangadex-full-api - v6.2.0
    Preparing search index...

    Class Relationship<T>

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

    Type Parameters

    Hierarchy (View Summary)

    Index

    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.

    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

    Methods

    • Returns the cached related object, or undefined if nothing is cached. Unlike resolve(), this does not fetch data or perform any I/O.

      Returns T | undefined

    • 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 be missing relationships.

      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