UNPKG

imagic-sdk

Version:

Official Node.js SDK for Imagic image optimization API

43 lines 1.3 kB
import { ImagicClientConfig, UploadOptions, ApiResponse, ApiInfo } from "./types"; /** * Official Imagic Node.js SDK Client */ export declare class ImagicClient { private readonly apiKey; private readonly baseUrl; private readonly timeout; constructor(config: ImagicClientConfig); /** * Upload an image file to Imagic * @param input - File path (string) or Buffer * @param options - Upload options * @returns Promise<ApiResponse> */ upload(input: string | Buffer, options?: UploadOptions): Promise<ApiResponse>; /** * Upload multiple images * @param inputs - Array of file paths or buffers * @param options - Upload options * @returns Promise<ApiResponse[]> */ uploadMultiple(inputs: Array<string | Buffer>, options?: UploadOptions): Promise<ApiResponse[]>; /** * Get API information * @returns Promise<ApiInfo> */ getApiInfo(): Promise<ApiInfo>; /** * Test the API connection and authentication * @returns Promise<boolean> */ testConnection(): Promise<boolean>; /** * Make HTTP request to the API */ private makeRequest; /** * Handle error responses from the API */ private handleErrorResponse; } //# sourceMappingURL=client.d.ts.map