@skbhati199/ai-img-gen-js
Version:
JavaScript/TypeScript SDK for AI Image Generator API
78 lines (77 loc) • 2.36 kB
TypeScript
import { ApiResponse, ClientConfig, ConvertImageOptions, HealthStatus, ImageGenerationOptions, Metrics, OptimizeImageOptions, ResizeImageOptions, SupportedFormat, SupportedSize } from './types';
/**
* AI Image Generator SDK Client
*
* A client for interacting with the AI Image Generator API
*/
export declare class AIImageGeneratorClient {
private client;
private baseUrl;
/**
* Create a new AI Image Generator client
*
* @param config - Configuration options for the client
*/
constructor(config: ClientConfig);
/**
* Generate an image using AI
*
* @param options - Image generation options
* @returns URL of the generated image
*/
generateImage(options: ImageGenerationOptions): Promise<string>;
/**
* Get a list of supported AI models
*
* @returns List of supported models
*/
getSupportedModels(): Promise<ApiResponse<string[]>>;
/**
* Get a list of supported image sizes
*
* @returns List of supported image sizes
*/
getSupportedSizes(): Promise<ApiResponse<SupportedSize[]>>;
/**
* Resize an existing image
*
* @param id - ID of the image to resize
* @param options - Resize options
* @returns URL of the resized image
*/
resizeImage(id: string, options: ResizeImageOptions): Promise<string>;
/**
* Convert an image to a different format
*
* @param id - ID of the image to convert
* @param options - Conversion options
* @returns URL of the converted image
*/
convertImage(id: string, options: ConvertImageOptions): Promise<string>;
/**
* Optimize an image for web delivery
*
* @param id - ID of the image to optimize
* @param options - Optimization options
* @returns URL of the optimized image
*/
optimizeImage(id: string, options: OptimizeImageOptions): Promise<string>;
/**
* Get a list of supported image formats
*
* @returns List of supported image formats
*/
getSupportedFormats(): Promise<ApiResponse<SupportedFormat[]>>;
/**
* Get API metrics
*
* @returns API metrics
*/
getMetrics(): Promise<ApiResponse<Metrics>>;
/**
* Check API health
*
* @returns Health status
*/
checkHealth(): Promise<ApiResponse<HealthStatus>>;
}