import { Registrable } from "../registry"; import { FormItemProps } from "../d.ts"; export enum ContextScope { global, pipeline, runtime, } export type Storage = { scope: ContextScope; path: string; }; export type TaskOutputDefine = { title: string; value?: any; storage?: Storage; }; export type TaskInputDefine = FormItemProps; export type PluginDefine = Registrable & { default?: any; input?: { [key: string]: TaskInputDefine; }; output?: { [key: string]: TaskOutputDefine; }; autowire?: { [key: string]: any; }; reference?: { src: string; dest: string; type: "computed"; }[]; }; export type ITaskPlugin = { onInstance(): Promise; execute(): Promise; [key: string]: any; }; export type TaskResult = { clearLastStatus?: boolean; }; export abstract class AbstractTaskPlugin implements ITaskPlugin { result: TaskResult = {}; clearLastStatus() { this.result.clearLastStatus = true; } async onInstance(): Promise { return; } abstract execute(): Promise; } export type OutputVO = { key: string; title: string; value: any; };