import { type ReactNode } from 'react'; import type { FieldPatch, GraphEdit, InputPath, WorkflowEditing } from '../editing.js'; import { type Json, type OpenOnAdd } from './editorFields.js'; import { type InputsEditorStrings } from './editorStrings.js'; import { type InputSource } from './inputRefs.js'; import type { SettingsView } from './settingsViews.js'; /** Input types by menu group, in the order the add menu lists them. */ export declare const INPUT_TYPE_GROUPS: [keyof InputsEditorStrings['typeGroups'], string[]][]; declare const TEXT_FIELDS: readonly ['label', 'description', 'tooltip']; declare const FLAG_FIELDS: readonly ['optional', 'hidden', 'disabled', 'ignore']; type CommonKey = (typeof TEXT_FIELDS)[number] | (typeof FLAG_FIELDS)[number]; export declare function inputTypes(): string[]; export declare function commonKeys(type: string): CommonKey[]; /** Every key the dialog can write for an input of `type`. */ export declare function offeredInputKeys(editing: WorkflowEditing, type: string): string[]; /** The starting definition of a new input of `type`, with what the schema requires. */ export declare function newInputDefinition(type: string): Json; /** An input a dialog creates when it saves, for a field that reads it. */ export interface PendingInput { name: string; definition: Json; } export declare function allNames(editing: WorkflowEditing, map: Json, out: Set): Set; /** Where a dialog puts the inputs it creates: the top level, or one wizard step. */ export interface InputHome { parent: string[]; index?: number; } /** `edit` after the edits that add `created` at `home`, as one undo step. */ export declare function withCreatedInputs(editing: WorkflowEditing, created: PendingInput[], home: InputHome, edit: GraphEdit | null): GraphEdit | null; export interface NewInputs { source: InputSource; all: Json; home: InputHome; pending: PendingInput[]; adopt: (created: PendingInput[]) => void; dialog: ReactNode; /** The form's edit with the inputs it made, or null when there's nothing to save. */ save: (edit: GraphEdit | null) => GraphEdit | null; } /** Inputs a dialog's fields can read, plus the ones it creates on save. */ export declare function useNewInputs(inputs: Json | undefined, home?: InputHome): NewInputs; /** Every setting of one input; `onSave` gets the whole definition and the change to it. */ interface InputDialogProps { name: string; definition: Json; isNew: boolean; /** Names already taken in the same container. */ siblings: string[]; allowStep: boolean; /** The workflow's inputs, for settings that read another input. */ inputs?: Json | undefined; /** Where inputs made for this dialog's settings will go. */ home?: InputHome | undefined; /** A new input made for one field keeps the type that field needs. */ lockedType?: boolean; /** `created` are inputs this dialog made for its own settings. */ onSave: (name: string, definition: Json, patch: Required, created: PendingInput[]) => void; onDelete?: () => void; onClose: () => void; openOnAdd?: OpenOnAdd | undefined; } /** Saving an input as YAML text; `path` and `source` give an existing input's text with its comments. */ export interface InputYaml { source?: string | undefined; path?: InputPath | undefined; /** `created` are the inputs the form made for its settings before switching to the YAML. */ onSave: (name: string, yaml: string, created: PendingInput[]) => void; } /** An input's settings in a form, or as YAML when `yaml` says how to save it; switching carries the edits across. */ export declare function InputDialog({ yaml, view, onViewChange, ...props }: InputDialogProps & { yaml?: InputYaml | undefined; view?: SettingsView | undefined; onViewChange?: ((view: SettingsView) => void) | undefined; }): import("react").JSX.Element; /** A compact type chip for rows that list inputs. */ export declare function TypeBadge({ type }: { type: string; }): import("react").JSX.Element; export {};