UNPKG

@imgly/plugin-ai-generation-web

Version:

AI generation plugin for the CE.SDK editor

31 lines (30 loc) 999 B
import { Middleware } from './middleware'; import { Output } from '../core/provider'; /** * For a given edit mode and block ids, this middleware will * ensure that as long as these blocks are selected, the edit mode is * set to the given edit mode and cannot be changed. * * The use-case is to show only the generation canvas menu during * the generation process. */ declare function editModeMiddleware<I, O extends Output>({ editMode, automaticallyUnlock, showNotification }: { /** * The edit mode to lock the selection to. */ editMode: string; /** * Should the selection be automatically unlocked after the function completes? * Otherwise the returned unlock function must be called manually. * * @default false */ automaticallyUnlock?: boolean; /** * Should the blocks be set when the generation is done * * @default true */ showNotification?: boolean; }): Middleware<I, O>; export default editModeMiddleware;