UNPKG

flickr-sdk

Version:

Almost certainly the best Flickr API client in the world for node and the browser

76 lines (75 loc) 2.25 kB
import type { Auth, Transport } from "../types"; export interface UploadParams { /** * The title of the photo. */ title?: string; /** * A description of the photo. May contain some limited HTML. */ description?: string; /** * A space-seperated list of tags to apply to the photo. */ tags?: string; /**' * Set to 0 for no, 1 for yes. Specifies who can view the photo. * If omitted (or set to 9) permissions will be set to user's default */ is_public?: "0" | "1" | "9"; /**' * Set to 0 for no, 1 for yes. Specifies who can view the photo. * If omitted (or set to 9) permissions will be set to user's default */ is_friend?: "0" | "1" | "9"; /**' * Set to 0 for no, 1 for yes. Specifies who can view the photo. * If omitted (or set to 9) permissions will be set to user's default */ is_family?: "0" | "1" | "9"; /** * Set to 1 for Safe, 2 for Moderate, or 3 for Restricted. * If omitted or an invalid value is passed, will be set to user's default */ safety_level?: "1" | "2" | "3"; /** * Set to 1 for Photo, 2 for Screenshot, or 3 for Other. * If omitted (or set to 9), will be set to user's default */ content_type?: "1" | "2" | "3" | "9"; /** * Set to 1 to keep the photo in global search results, 2 to hide from * public searches. If omitted, will be set based to user's default */ hidden?: "1" | "2"; } export interface UploadFail { stat: "fail"; err: { code: number; msg: string; }; } export interface UploadOK { stat: "ok"; photoid: { secret: string; originalsecret: string; _content: string; }; } export type UploadResponse = UploadFail | UploadOK; export interface Upload { (file: string | Blob, params: UploadParams): Promise<{ id: string; secret: string; originalsecret: string; }>; } export declare class UploadService { private transport; private auth; constructor(transport: Transport, auth: Auth); upload(file: string | Blob, params?: Record<string, string>): ReturnType<Upload>; getBlob(file: string | Blob): Promise<string | Blob>; }