@imgly/plugin-ai-generation-web
Version:
AI generation plugin for the CE.SDK editor
39 lines (38 loc) • 1.46 kB
TypeScript
import CreativeEditorSDK, { BuilderRenderFunction } from '@cesdk/cesdk-js';
import Provider, { Output, OutputKind } from '../core/provider';
import { ProviderInitializationResult } from './initializeProvider';
import { CommonPluginConfiguration } from '../types';
export type ProvidersInitializationResult<K extends OutputKind, I, O extends Output> = {
/**
* Combined panel render function for all providers.
*/
panel: {
builderRenderFunction?: BuilderRenderFunction;
};
/**
* Combined history asset source and library entry IDs for the providers.
*/
history?: {
assetSourceId?: string;
assetLibraryEntryId?: string;
};
/**
* All individual initialization results of the providers, i.e.
* the result of `initializeProvider` for every provider.
*/
providerInitializationResults: ProviderInitializationResult<K, I, O>[];
};
/**
* Initializes the given providers for the specified output kind.
*
* - It will create a combined render function for all providers
* that can be used in a panel
*
*/
declare function initializeProviders<K extends OutputKind, I, O extends Output>(kind: K, providers: {
fromText: Provider<K, I, O>[];
fromImage: Provider<K, I, O>[];
} | Provider<K, I, O>[], options: {
cesdk: CreativeEditorSDK;
}, config: CommonPluginConfiguration<K, I, O>): Promise<ProvidersInitializationResult<K, I, O>>;
export default initializeProviders;