@imgly/plugin-ai-image-generation-web
Version:
AI image generation plugin for the CE.SDK editor
35 lines (34 loc) • 1.81 kB
TypeScript
import type CreativeEditorSDK from '@cesdk/cesdk-js';
import { EachLabsClient } from './createEachLabsClient';
/**
* Uploads an image to EachLabs storage if needed.
* Handles blob: and buffer: URLs by uploading them to EachLabs storage.
* Regular URLs and data URIs are passed through unchanged.
*
* @param client - The EachLabs client instance
* @param imageUrl - The image URL to process
* @param cesdk - Optional CE.SDK instance for buffer URL handling
* @returns The uploaded URL or the original URL if no upload was needed
*/
export declare function uploadImageInputToEachLabsIfNeeded(client: EachLabsClient, imageUrl?: string, cesdk?: CreativeEditorSDK): Promise<string | undefined>;
/**
* Uploads an array of images to EachLabs storage if needed.
* Used for multi-image inputs like image-to-image generation.
*
* @param client - The EachLabs client instance
* @param imageUrls - Array of image URLs to process
* @param cesdk - Optional CE.SDK instance for buffer URL handling
* @returns Array of uploaded URLs
*/
export declare function uploadImageArrayToEachLabsIfNeeded(client: EachLabsClient, imageUrls?: string[], cesdk?: CreativeEditorSDK): Promise<string[] | undefined>;
/**
* @deprecated Use uploadImageInputToEachLabsIfNeeded instead
* Converts a blob: or buffer: URL to a data URI that EachLabs can accept
*/
export declare function convertImageUrlForEachLabs(imageUrl?: string, cesdk?: CreativeEditorSDK): Promise<string | undefined>;
/**
* @deprecated Use uploadImageArrayToEachLabsIfNeeded instead
* Converts an array of blob:/buffer: URLs to data URIs for EachLabs.
* Used for multi-image inputs like image-to-image generation.
*/
export declare function convertImageUrlArrayForEachLabs(imageUrls?: string[], cesdk?: CreativeEditorSDK): Promise<string[] | undefined>;