booru
Version:
Search (and do other things) on a bunch of different boorus!
53 lines • 1.51 kB
TypeScript
/**
* @packageDocumentation
* @module Structures
*/
import type Booru from '../boorus/Booru';
import type Tag from './Tag';
import type TagListParameters from './TagListParameters';
/**
* Represents a page of tag list results, works like an array of {@link Tag}
* <p> Usable like an array and allows to easily get the next page
*
* @example
* ```
* const Booru = require('booru')
* // Safebooru
* const sb = new Booru('sb')
*
* const tags = await sb.tagList()
*
* // Log the tags from the first page, then from the second
* tags.forEach(t => console.log(t.name))
* const tags2 = await tags.nextPage()
* tags2.forEach(t => console.log(t.name))
* ```
*/
export default class TagListResults extends Array<Tag> {
/** The booru used for this tag list */
booru: Booru;
/** The page of this tag list */
page: number;
/** The options used for this tag list */
readonly options: TagListParameters;
/** The tags from this tag list result */
readonly tags: Tag[];
/** @private */
constructor(tags: Tag[], options: TagListParameters, booru: Booru);
/**
* Get the first tag in this result set
* @return {Tag}
*/
get first(): Tag;
/**
* Get the last tag in this result set
* @return {Tag}
*/
get last(): Tag;
/**
* Get the next page of results
* @returns {Promise<TagListResults>} The next page of results
*/
nextPage(): Promise<TagListResults>;
}
//# sourceMappingURL=TagListResults.d.ts.map