grab-picture
Version: 
grab your images in secconds
53 lines • 1.51 kB
TypeScript
export interface GrabPicOptions {
    count?: number;
    orientation?: "landscape" | "portrait" | "squarish";
    size?: "raw" | "full" | "regular" | "small" | "thumb";
}
export interface UnsplashPhoto {
    id: string;
    urls: {
        raw: string;
        full: string;
        regular: string;
        small: string;
        thumb: string;
    };
    alt_description: string | null;
    description: string | null;
}
export interface UnsplashResponse {
    results: UnsplashPhoto[];
    total: number;
    total_pages: number;
}
export interface GrabPicResponse {
    success: boolean;
    data?: string[];
    error?: string;
    statusCode?: number;
    meta?: {
        query: string;
        count: number;
        actualCount: number;
        orientation?: string;
        size: string;
    };
}
export declare enum GrabPicErrorType {
    INVALID_ACCESS_KEY = "INVALID_ACCESS_KEY",
    MISSING_QUERY = "MISSING_QUERY",
    MISSING_ACCESS_KEY = "MISSING_ACCESS_KEY",
    INVALID_COUNT = "INVALID_COUNT",
    RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED",
    NO_RESULTS_FOUND = "NO_RESULTS_FOUND",
    NETWORK_ERROR = "NETWORK_ERROR",
    API_ERROR = "API_ERROR",
    UNKNOWN_ERROR = "UNKNOWN_ERROR"
}
export declare class GrabPicError extends Error {
    readonly type: GrabPicErrorType;
    readonly statusCode: number;
    readonly originalError?: Error;
    constructor(message: string, type: GrabPicErrorType, statusCode?: number, originalError?: Error);
}
//# sourceMappingURL=types.d.ts.map