UNPKG

imgur

Version:

Unofficial JavaScript library for Imgur

26 lines (24 loc) 989 B
import { ImgurClient } from '../client'; import { ImgurApiResponse, GalleryData } from '../common/types'; import { URL } from 'whatwg-url'; export type SearchOptions = { q?: string; query?: string; sort?: 'time' | 'viral'; page?: number; }; export type TopSearchOptions = Omit<SearchOptions, 'sort'> & { sort?: 'top'; window?: 'day' | 'week' | 'month' | 'year' | 'all'; }; export type AdvancedSearchQueryParameters = { q_all?: string; q_any?: string; q_exactly?: string; q_not?: string; q_type?: 'jpg' | 'png' | 'gif' | 'anigif' | 'album'; q_size_px?: 'small' | 'med' | 'big' | 'lrg' | 'huge'; }; export type SearchGalleryOptions = (SearchOptions | TopSearchOptions) & AdvancedSearchQueryParameters; export declare function constructSearchGalleryUrl(options: SearchGalleryOptions): URL; export declare function searchGallery(client: ImgurClient, options: SearchGalleryOptions): Promise<ImgurApiResponse<GalleryData>>;