import type { ProblemParams } from '../components/Provider.js'; import type { GraphEdit, GraphEditResult } from '../editing.js'; import type { Box } from './editorPrimitives.js'; import type { ListedProblem } from './ProblemsButton.js'; import type { SettingsView } from './settingsViews.js'; export type { Box }; export interface EditorProblem { /** Its text, shown when it has no `code` or the host has no message for it. */ message: string; /** Its stable code, which the host's `useProblemMessage` shows in the reader's language with * `params`. */ code?: string | null | undefined; /** The values the code's message shows, by name. */ params?: ProblemParams | null | undefined; /** The URI of the page that explains it, which the problems list links to, and which the host's * `useProblemMessage` gets with its `code`. `about:blank` has none. */ type?: string | null | undefined; line: number; job?: string; step?: number; input?: string[]; /** In a workflow-level setting the settings dialog edits. */ setting?: boolean; } /** What to show in the YAML beside the graph: a job, one of its steps, or a line. */ export type RevealTarget = { job: string; step?: number; } | { line: number; }; /** Build-page callbacks that turn the dependency graph into an editor. */ export interface DependencyGraphEditor { onEdit: (edit: GraphEdit) => GraphEditResult | undefined; canUndo: boolean; canRedo: boolean; onUndo: () => void; onRedo: () => void; /** `uses` values offered in the step editor, such as the user's own workflows. */ usesSuggestions?: string[]; /** Opens the workflow-level settings: env, permissions, sessions and more. */ onOpenSettings?: () => void; /** The YAML the edits apply to, for editing a job or step as text. */ readSource?: () => string; /** The view the job, step and input dialogs open in; YAML when not given. */ settingsView?: SettingsView; onSettingsViewChange?: (view: SettingsView) => void; /** False adds a new job, step or input with its defaults, without opening its dialog. */ openOnAdd?: boolean; onOpenOnAddChange?: (open: boolean) => void; /** Problems in the workflow, marked on the jobs, steps and inputs they're in. */ problems?: EditorProblem[]; /** The problems this pane's toolbar counts and lists. */ listedProblems?: ListedProblem[]; /** Hands the page this pane's way to bring a problem into view, false where it can't; returns its undo. */ registerShow?: (show: (problem: EditorProblem) => boolean) => () => void; /** Shows a job's, step's or line's YAML, when the YAML editor is beside the graph. */ onReveal?: (target: RevealTarget) => void; } export declare const typing: (target: EventTarget | null) => boolean; export declare function overlaps(rect: DOMRect, box: Box): boolean;