import { CommonPluginConfiguration, GetProvider, Output, Provider, ImageOutput } from '@imgly/plugin-ai-generation-web'; /** * Configuration to set provider and models for image generation. */ export interface PluginConfiguration extends CommonPluginConfiguration<'image', I, O> { providers: { /** * Provider of a model for image generation just from a (prompt) text. */ text2image?: GetProvider<'image'>[] | GetProvider<'image'>; /** * Provider of a model for image generation from a given image. */ image2image?: GetProvider<'image'>[] | GetProvider<'image'>; }; /** * Provider of a model for image generation just from a (prompt) text. * @deprecated Use `providers.text2image` instead. */ text2image?: GetProvider<'image'>[] | GetProvider<'image'>; /** * Provider of a model for image generation from a given image. * @deprecated Use `providers.image2image` instead. */ image2image?: GetProvider<'image'>[] | GetProvider<'image'>; } /** * Input types for image-specific quick actions * This interface is extended by individual quick action files using module augmentation */ export interface ImageQuickActionInputs { } /** * Type-safe support mapping for image quick actions * Allows `true` or `{}` when the quick action input type extends the provider input type */ export type ImageQuickActionSupport = ImageQuickActionInputs[K] extends I ? true | { mapInput: (input: ImageQuickActionInputs[K]) => I; } | { [key: string]: any; } : { mapInput: (input: ImageQuickActionInputs[K]) => I; }; /** * Type-safe mapping for image quick action support */ export type ImageQuickActionSupportMap = { [K in keyof ImageQuickActionInputs]?: ImageQuickActionSupport; } & { [key: string]: true | { mapInput: (input: any) => I; } | { [key: string]: any; }; }; /** * Image provider extension with type-safe quick action support * Only parameterized by K (the quick action key), O is fixed to ImageOutput */ export interface ImageProvider extends Provider<'image', I, ImageOutput> { input: Omit['input'], 'quickActions'> & { quickActions?: { supported?: ImageQuickActionSupportMap; }; }; }