node-hitomi
Version:
Hitomi.la API for Node.js
198 lines (195 loc) • 4.2 kB
TypeScript
import { Image, Video } from './media.js';
import { Language, Tag } from './tag.js';
import { Base } from '../internal/base.js';
import { GalleryManager } from '../managers/gallery.js';
/**
* A title associated with a gallery.
*
* @see {@link Gallery}
*/
declare class Title {
/**
* The display title of the gallery.
*
* @type {string}
* @readonly
*/
readonly display: string;
/**
* The Japanese title of the gallery.
*
* @deprecated Always `null`.
* @type {string | null}
* @readonly
*/
readonly japanese: string | null;
}
/**
* A lightweight reference to a gallery by its unique identifier.
*
* @see {@link Gallery}
* @see {@link GalleryManager}
*/
declare class GalleryReference extends Base {
/**
* The unique identifier of the gallery.
*
* @type {number}
* @readonly
*/
readonly id: number;
/**
* Retrieves the full gallery for this reference.
*
* @returns {Promise<Gallery>} A `Promise` that resolves to the full gallery.
* @see {@link Gallery}
*/
retrieve(): Promise<Gallery>;
}
/**
* A translated gallery reference for a specific language.
*
* @extends {Gallery}
* @see {@link Gallery}
*/
declare class TranslatedGallery extends GalleryReference {
/**
* The language of the translated gallery, or `null` if unavailable.
*
* @type {Language | null}
* @readonly
* @see {@link Language}
*/
readonly language: Language | null;
/**
* The URL path of the gallery.
*
* @type {string}
* @readonly
*/
readonly url: string;
}
/**
* A complete gallery including metadata, media files, and relationships.
*
* @extends {TranslatedGallery}
* @see {@link GalleryManager}
*/
declare class Gallery extends TranslatedGallery {
/**
* The title of the gallery.
*
* @type {Title}
* @readonly
* @see {@link Title}
*/
readonly title: Title;
/**
* The 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 {Tag[]}
* @readonly
* @see {@link Tag}
*/
readonly artists: readonly Tag[];
/**
* Group tags associated with the gallery.
*
* @type {Tag[]}
* @readonly
* @see {@link Tag}
*/
readonly groups: readonly Tag[];
/**
* Series (parody) tags associated with the gallery.
*
* @type {Tag[]}
* @readonly
* @see {@link Tag}
*/
readonly series: readonly Tag[];
/**
* Character tags associated with the gallery.
*
* @type {Tag[]}
* @readonly
* @see {@link Tag}
*/
readonly characters: readonly Tag[];
/**
* General, male, and female tags associated with the gallery.
*
* @type {Tag[]}
* @readonly
* @see {@link Tag}
*/
readonly tags: readonly Tag[];
/**
* The image files in the gallery.
*
* @type {Image[]}
* @readonly
* @see {@link Image}
*/
readonly files: readonly Image[];
/**
* Available translations in other languages.
*
* @type {TranslatedGallery[]}
* @readonly
* @see {@link TranslatedGallery}
*/
readonly translations: readonly TranslatedGallery[];
/**
* References to related galleries.
*
* @type {GalleryReference[]}
* @readonly
* @see {@link GalleryReference}
*/
readonly relations: readonly GalleryReference[];
/**
* Whether the gallery is blocked.
*
* @type {boolean}
* @readonly
*/
readonly isBlocked: boolean;
/**
* The date when the gallery was added.
*
* @type {Date}
* @readonly
*/
readonly addedDate: Date;
/**
* The date when the original work was published, or `null` if unavailable.
*
* @type {Date | null}
* @readonly
*/
readonly publishedDate: Date | null;
/**
* The video resource associated with the gallery, or `null` if unavailable.
*
* @type {Video | null}
* @readonly
* @see {@link Video}
*/
readonly video: Video | null;
/**
* Returns a pair of representative thumbnail images.
*
* @returns {[Image, Image]} A tuple of the first and middle images from the gallery.
* @see {@link Image}
*/
getThumbnails(): [Image, Image];
}
export { Gallery, GalleryReference, Title, TranslatedGallery };