booru
Version:
Search (and do other things) on a bunch of different boorus!
47 lines • 1.84 kB
TypeScript
/**
* @packageDocumentation
* @module Constants
*/
import type { RequestInit } from 'undici';
import type { BooruCredentials } from './boorus/Booru';
import type Site from './structures/Site';
import type SiteInfo from './structures/SiteInfo';
export type AnySite = 'e621.net' | 'e926.net' | 'hypnohub.net' | 'danbooru.donmai.us' | 'konachan.com' | 'konachan.net' | 'yande.re' | 'gelbooru.com' | 'rule34.xxx' | 'safebooru.org' | 'tbib.org' | 'xbooru.com' | 'rule34.paheal.net' | 'derpibooru.org' | 'realbooru.com';
/**
* A map of site url/{@link SiteInfo}
*/
export declare const sites: Record<AnySite, SiteInfo>;
/**
* Custom error type for when the boorus error or for user-side error, not my code (probably)
* <p>The name of the error is 'BooruError'
* @type {Error}
*/
export declare class BooruError extends Error {
constructor(message: string | Error);
}
/**
* The user-agent to use for searches
* @private
*/
export declare const USER_AGENT: string;
/**
* Create a full uri to search with
*
* @private
* @param {string} domain The domain to search
* @param {Site} site The site to search
* @param {string[]} [tags=[]] The tags to search for
* @param {number} [limit=100] The limit for images to return
* @param {number} [page=0] The page to get
* @param {BooryCredentials} [credentials] The credentials to use for the search, appended to the querystring
*/
export declare function searchURI(site: Site, tags?: string[], limit?: number, page?: number, credentials?: BooruCredentials): string;
export declare function tagListURI(site: Site, limit?: number, page?: number, credentials?: BooruCredentials): string;
/**
* The default options to use for requests
* <p>I could document this better but meh
*
* @private
*/
export declare const defaultOptions: RequestInit;
//# sourceMappingURL=Constants.d.ts.map