Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AnimePage<T>

AnimePage reflects a page that is dedicated to a specific Anime.

Type parameters

Hierarchy

Implements

Index

Constructors

constructor

Properties

Private _animeSearchDialogOpen$

_animeSearchDialogOpen$: Subject<SearchDialogOpenCommand>

Private Optional _episodesWatched$

_episodesWatched$: BehaviorSubject<number | undefined>

backgroundPages

backgroundPages: Map<any, ServicePage<T>>

ServicePages which are running as a child of the current page.

Protected internalMemory

internalMemory: Namespace

Private lowConfidenceWarningShown

lowConfidenceWarningShown: Set<string>

memory

service

service: T

state

state: State<T>

Methods

Private Abstract _getEpisodesWatched

  • _getEpisodesWatched(): Promise<number | undefined>

_load

  • _load(): Promise<void>

Private Abstract _setEpisodesWatched

  • _setEpisodesWatched(progress: number): Promise<boolean>

Protected _unload

  • _unload(): Promise<void>

Protected assignMemory

buildAnimeSearchDialog

  • buildAnimeSearchDialog(): Promise<Element>

buildAnimeStatusBar

  • buildAnimeStatusBar(): Promise<Element>

Abstract canSetEpisodesWatched

  • canSetEpisodesWatched(): Promise<boolean>
  • Sanity check whether it should be possible to set the "progress" of an Anime.

    Returns Promise<boolean>

canSubscribeAnime

  • canSubscribeAnime(): Promise<boolean>

canSubscribeAnime$

  • canSubscribeAnime$(): Promise<Observable<boolean>>
  • Observable denoting whether it is possible (read: allowed) to subscribe to the Anime.

    Returns Promise<Observable<boolean>>

forget

  • forget(key: string, forgetNamespace?: undefined | false | true): void
  • Delete the value of the provided namespace key.

    Parameters

    • key: string
    • Optional forgetNamespace: undefined | false | true

      if true this operation behaves like Memory.resetMemory with the key as an argument. Otherwise it merely removes the specified namespace.

    Returns void

getAnime

Abstract getAnimeIdentifier

  • getAnimeIdentifier(): Promise<string | undefined>

Abstract getAnimeSearchQuery

  • getAnimeSearchQuery(): Promise<string | undefined>
  • Get the search query to be used for Grobber's search endpoint.

    Returns Promise<string | undefined>

    undefined if there is no search query.

getAnimeUID

  • getAnimeUID(forceSearch?: undefined | false | true): Promise<string | undefined>
  • Get the UID of the Anime. This method will return the stored UID (if available) unless forceSearch is true.

    Parameters

    • Optional forceSearch: undefined | false | true

      Ignore the stored UID.

    Returns Promise<string | undefined>

    undefined if there were no results or the AnimePage.getAnimeSearchQuery was empty

Abstract getAnimeURL

  • getAnimeURL(): Promise<string | undefined>

getBackgroundPage

  • getBackgroundPage(id: any): ServicePage<T> | undefined

Abstract getEpisodeCount

  • getEpisodeCount(): Promise<number | undefined>
  • Get the amount of episodes this Anime has. Note that this is not the amount of episodes available on Grobber but the amount reported by the site which should ideally be the total amount.

    see

    AnimePage.getAnime's AnimeInfo.episodes for the amount of available episodes.

    Returns Promise<number | undefined>

Abstract getEpisodeURL

  • getEpisodeURL(episodeIndex: number): Promise<string | undefined>
  • Get the URL of the provided episode for this Anime.

    Parameters

    • episodeIndex: number

    Returns Promise<string | undefined>

getEpisodesWatched

  • getEpisodesWatched(): Promise<number | undefined>
  • Get the amount of episodes the user has seen.

    Returns Promise<number | undefined>

    undefined if the user is not watching this particular Anime.

getEpisodesWatched$

  • getEpisodesWatched$(): Promise<BehaviorSubject<number | undefined>>

getStoredAnimeInfo

getSubscribed$

  • getSubscribed$(): Promise<Observable<boolean> | undefined>
  • Observable denoting whether the user is subscribed to the Anime

    Returns Promise<Observable<boolean> | undefined>

getSubscription

injectAnimeSearchDialog

  • injectAnimeSearchDialog(searchDialog: Element): Promise<void>

Abstract injectAnimeStatusBar

  • injectAnimeStatusBar(statusBar: Element): Promise<void>

injected

  • injected(el: Node, ns?: undefined | string): void

isSubscribed

  • isSubscribed(): Promise<boolean | undefined>

load

  • load(): Promise<void>

openAnimeSearchDialog

  • openAnimeSearchDialog(onClose?: undefined | function): Promise<void>
  • Open the anime search dialog.

    Parameters

    • Optional onClose: undefined | function

    Returns Promise<void>

registerBackgroundPage

  • registerBackgroundPage(page: ServicePage<T>, id: any): void

reload

  • reload(): Promise<void>

remember

  • remember(key: string, value: any): void
  • Store the given value under the namespace key.

    Parameters

    • key: string

      Namespaces are separated by a dot

    • value: any

    Returns void

removeInjected

  • removeInjected(...namespaces: string[]): void
  • Remove all elements from the given namespaces. Removing elements of a namespace also removes all elements in namespaces further down.

    If no namespaces provided removes all elements.

    Parameters

    • Rest ...namespaces: string[]

    Returns void

resetMemory

  • resetMemory(...namespaces: string[]): void
  • Reset the given namespaces and all their children.

    When called with no arguments this flushes the entire memory (i.e. deletes all keys).

    see

    Memory.forget to remove a specific namespace without affecting its children.

    Parameters

    • Rest ...namespaces: string[]

    Returns void

resetPage

  • resetPage(): void

setAnimeUID

  • setAnimeUID(uid: string | AnimeInfo): Promise<void>

setEpisodesWatched

  • setEpisodesWatched(progress: number): Promise<boolean>
  • Set the amount of episodes watched.

    Parameters

    • progress: number

    Returns Promise<boolean>

    whether the action was successful.

Abstract showEpisode

  • showEpisode(episodeIndex: number): Promise<boolean>
  • Navigate the user to the episode with the given index.

    Parameters

    • episodeIndex: number

    Returns Promise<boolean>

subscribeAnime

  • subscribeAnime(): Promise<boolean>
  • Subscribe to the Anime.

    Returns Promise<boolean>

    Whether the subscription was successful

transitionTo

unload

  • unload(): Promise<void>

unsubscribeAnime

  • unsubscribeAnime(): Promise<boolean>
  • Unsubscribe from the Anime.

    Returns Promise<boolean>

    Whether the action was successful.

updateSubscription

  • updateSubscription(episodesWatched?: number | PromiseLike<number>): Promise<void>
  • Update the subscription for this Anime.

    Parameters

    • Optional episodesWatched: number | PromiseLike<number>

    Returns Promise<void>

    Whether the action was successful.

Generated using TypeDoc