Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Danbooru2

A Booru implementation for sites running Danbooru version 2

Hierarchy

Index

Constructors

constructor

Properties

base

base: string

Base URI of a booru site

Protected converter

converter: Converter = Danbooru2Converter

Optional options

options: Map<string, any>

Stores any global options for the booru. This has different members based on the booru type.

Protected Optional pCredentials

pCredentials: Credentials

Stores credentials for authentication. From outside the class, use credentials accessor or set it in the constructor directly.

Protected uriBuilder

uriBuilder: UriBuilder = Danbooru2UriBuilder

xml

xml: false = false

Accessors

credentials

Protected fetchOptions

  • get fetchOptions(): object

loggedIn

  • get loggedIn(): boolean

Methods

artist

  • artist(id: number | string): Promise<Artist>

artists

comment

  • comment(id: number | string): Promise<Comment>

comments

favorite

  • favorite(id: number): Promise<boolean>

Protected fetch

  • fetch(path: string, config?: undefined | object): Promise<any>
  • GET an API call result as an object

    Parameters

    • path: string

      Part of the URI appended to the base

    • Optional config: undefined | object

      Axios config object

    Returns Promise<any>

Protected genericQuery

  • genericQuery(type: string, query: Query.Any): Promise<any[]>

Protected genericSingle

  • genericSingle(type: string, id: number | string): Promise<any>

note

  • note(id: number | string): Promise<Note>
  • Get a single Note by ID

    Parameters

    • id: number | string

      ID of the note

    Returns Promise<Note>

notes

  • Get an array of Notes that match a query

    Parameters

    • query: Notes

      Notes search query object

    Returns Promise<Note[]>

  • Get back the Post you passed in with the notes field populated

    Parameters

    • post: Post

      The post to find notes for

    Returns Promise<Post>

pool

  • pool(id: number): Promise<Pool>

pools

post

  • post(id: number | string): Promise<Post>
  • Get a single Post by ID

    Parameters

    • id: number | string

      ID of the post

    Returns Promise<Post>

posts

unfavorite

  • unfavorite(id: number): Promise<boolean>

user

  • user(id: number | string): Promise<User>
  • Get a single User by ID

    Parameters

    • id: number | string

      ID of the user

    Returns Promise<User>

users

wiki

  • wiki(id: number | string): Promise<Wiki>
  • Get a single Wiki page by ID

    Parameters

    • id: number | string

      ID of the wiki page

    Returns Promise<Wiki>

wikis

Generated using TypeDoc