import { ComponentOptions } from 'vue'; import { Accountability } from './accountability'; import { ApiExtensionContext } from './extensions'; import { Field } from './fields'; import { DeepPartial } from './misc'; import { FlowRaw } from './flows'; type OperationContext = ApiExtensionContext & { data: Record; accountability: Accountability | null; }; export type OperationHandler> = ( options: Options, context: OperationContext ) => unknown | Promise | void; export interface OperationAppConfig { id: string; name: string; icon: string; description?: string; overview: | (( options: Record, { flow }: { flow: FlowRaw } ) => { label: string; text: string; copyable?: boolean }[]) | ComponentOptions | null; options: DeepPartial[] | ((options: Record) => DeepPartial[]) | ComponentOptions | null; } export interface OperationApiConfig> { id: string; handler: OperationHandler; }