import { Hitomi } from './hitomi.js'; import { Image, Video } from './media.js'; import { Language, Tag } from './tag.js'; import { SortType } from './utilities/constants.js'; import { Base } from './utilities/structures.js'; /** * Title associated with a gallery. * * @see {@link Gallery} */ declare class Title { /** * Display title of the gallery. * * @type {string} * @readonly */ readonly display: string; /** * Japanese title of the gallery. * * @deprecated This field is always null. * @type {string | null} * @readonly */ readonly japanese: string | null; } /** * Reference to a gallery with a unique identifier. * * @see {@link Gallery} * @see {@link GalleryManager} */ declare class GalleryReference extends Base { /** * Unique identifier of the gallery. * * @type {number} * @readonly */ readonly id: number; constructor(hitomi: Hitomi, /** * Unique identifier of the gallery. * * @type {number} * @readonly */ id: number); /** * Retrieves a full {@link Gallery} associated with the unique identifier. * * @returns {Promise} Promise that resolves to a full {@link Gallery} instance. */ retrieve(): Promise; } /** * Partial gallery for a specific language. * * @see {@link Gallery} */ declare class TranslatedGallery extends GalleryReference { /** * Language of the gallery. (`null` if unavailable) * * @type {Language | null} * @readonly */ readonly language: Language | null; /** * URL path of the gallery. * * @type {string} * @readonly */ readonly url: string; } /** * Full gallery with metadata, files, and relationships. * * @see {@link GalleryManager} */ declare class Gallery extends TranslatedGallery { /** * Title of the gallery. * * @type {Title} * @readonly */ readonly title: Title; /** * Type of the gallery. * * @type {'doujinshi' | 'manga' | 'artistcg' | 'gamecg' | 'imageset' | 'anime'} * @readonly */ readonly type: 'doujinshi' | 'manga' | 'artistcg' | 'gamecg' | 'imageset' | 'anime'; /** * Artist tags associated with the gallery. * * @type {readonly Tag[]} * @readonly */ readonly artists: readonly Tag[]; /** * Group tags associated with the gallery. * * @type {readonly Tag[]} * @readonly */ readonly groups: readonly Tag[]; /** * Series (parody) tags associated with the gallery. * * @type {readonly Tag[]} * @readonly */ readonly series: readonly Tag[]; /** * Character tags associated with the gallery. * * @type {readonly Tag[]} * @readonly */ readonly characters: readonly Tag[]; /** * General, male, and female tags associated with the gallery. * * @type {readonly Tag[]} * @readonly */ readonly tags: readonly Tag[]; /** * Image files in the gallery. * * @type {readonly Image[]} * @readonly */ readonly files: readonly Image[]; /** * Available translations in other languages. * * @type {readonly TranslatedGallery[]} * @readonly */ readonly translations: readonly TranslatedGallery[]; /** * References to related galleries. * * @type {readonly GalleryReference[]} * @readonly */ readonly relations: readonly GalleryReference[]; /** * Whether the gallery is blocked. * * @type {boolean} * @readonly */ readonly isBlocked: boolean; /** * Date when the gallery was added. * * @type {Date} * @readonly */ readonly addedDate: Date; /** * Date when the original work was published. (`null` if unavailable) * * @type {Date | null} * @readonly */ readonly publishedDate: Date | null; /** * Video resource associated with the gallery. (`null` if unavailable) * * @type {Video | null} * @readonly */ readonly video: Video | null; /** * Returns representative thumbnails. * * @returns {[Image, Image]} Tuple containing the first and middle image. */ getThumbnails(): [Image, Image]; } /** * Manager for retrieving and listing {@link Gallery} instances. * * @see {@link Hitomi} */ declare class GalleryManager extends Base { /** * Retrieves a {@link Gallery} by a unique identifier. * * @param {number} id Unique gallery identifier. * @returns {Promise} Promise that resolves to a {@link Gallery} instance. */ retrieve(id: number): Promise; /** * Lists {@link GalleryReference} entries that match the specified search criteria. * * When `options.page` is provided, only one non-language tag (optionally combined with a language tag) is allowed, and negative tags are not supported. * * When using `Popularity{Period}` in `options.orderBy`, the number of galleries may vary. * * @param {object} [options] Search options. * @param {Tag[]} [options.tags] Tag filters as {@link Tag} instances. * @param {string} [options.title] Title query string. * @param {SortType} [options.orderBy=SortType.DateAdded] Sort order. (defaults to `SortType.DateAdded`) * @param {object} [options.page] Pagination options. * @param {number} [options.page.index=0] Zero-based page index. (defaults to `0` when `options.page` is provided) * @param {number} [options.page.size=25] Number of galleries per page. (defaults to `25` when `options.page` is provided) * @returns {Promise} Promise that resolves to an array of {@link GalleryReference} instances. * @throws {HitomiError} Thrown when `page` is used with multiple tags or any negative tag. * @see {@link SortType} */ list(options?: { tags?: Tag[]; title?: string; orderBy?: SortType; page?: { index?: number; size?: number; }; }): Promise; } export { Gallery, GalleryManager, GalleryReference, Title, TranslatedGallery };