import { AutomationTarget, IAutomationDescriptor } from "./automation.js"; import { ICreateAutomationOptions, IUpdateAutomationOptions } from "./automationService.js"; export type AutomationDialogCreateInitialValues = Omit & { readonly target?: AutomationTarget; }; export type IShowAutomationDialogOptions = ({ readonly existing: IAutomationDescriptor; readonly initialValues?: never; } | { readonly existing?: never; readonly initialValues?: AutomationDialogCreateInitialValues; }) & { /** * Persists the result while the dialog stays open and shows progress. A rejection * is shown in the dialog so the user can retry or cancel; the dialog resolves * only after `commit` succeeds. */ readonly commit?: (result: IAutomationDialogResult) => Promise; }; export type IAutomationDialogResult = { readonly kind: "create"; readonly value: ICreateAutomationOptions; } | { readonly kind: "update"; readonly id: string; readonly value: IUpdateAutomationOptions; };