UNPKG

imgur

Version:

Unofficial JavaScript library for Imgur

29 lines (27 loc) 1.04 kB
import { ImgurClient } from '../client'; import { ImgurApiResponse, GalleryData } from '../common/types'; import { URL } from 'whatwg-url'; export type CommonSectionProps = { sort?: 'viral' | 'top' | 'time'; page?: number; }; export type HotSection = CommonSectionProps & { section: 'hot'; }; export type TopSection = CommonSectionProps & { section: 'top'; window?: 'day' | 'week' | 'month' | 'year' | 'all'; }; export type UserSection = Omit<CommonSectionProps, 'sort'> & { section: 'user'; sort?: 'viral' | 'top' | 'time' | 'rising'; }; export type SectionOptions = HotSection | TopSection | UserSection; export type PresentationOptions = { showViral?: boolean; mature?: boolean; album_previews?: boolean; }; export type GalleryOptions = SectionOptions & PresentationOptions; export declare function constructGalleryUrl(options: GalleryOptions): URL; export declare function getGallery(client: ImgurClient, options?: GalleryOptions): Promise<ImgurApiResponse<GalleryData>>;