/** * An automation's "When": its schedule and its event triggers, each optional. * With neither it runs only when someone presses Run now. Controlled and * data-agnostic like `EventTriggersField`: the host passes the sources it can * read and a loader for each source's event types. */ import { type ReactNode } from "react"; import type { EventSource, EventTypeDescriptor } from "@opengeni/sdk"; import { type CadenceFrequency, type CadenceTimeZoneOption, type CadenceValue } from "../../ui/cadence-picker.js"; import type { EventSourceChoice } from "./event-source-model.js"; import type { EventSourceLogoResolver } from "./event-source-tile.js"; import type { EventTriggersDraft, EventTriggersIssues } from "./event-trigger-model.js"; /** * The frequencies an automation's schedule can store. No "Every month on day * N": the API's calendar spec has no day of month yet. */ export declare const AUTOMATION_FREQUENCIES: readonly CadenceFrequency[]; export interface AutomationWhenFieldProps { /** Null: no schedule. */ cadence: CadenceValue | null; onCadenceChange: (cadence: CadenceValue | null) => void; events: EventTriggersDraft; onEventsChange: (events: EventTriggersDraft) => void; /** Event triggers run here. False offers the schedule only. */ eventTriggers: boolean; /** Sources the person can point triggers at; undefined while loading. */ sources: EventSource[] | undefined; /** Reads one source's event types. */ loadEventTypes: (sourceId: string) => Promise; eventIssues?: EventTriggersIssues | undefined; /** Why the schedule and the events don't fit together. */ error?: string | undefined; sourceLogo?: EventSourceLogoResolver | undefined; /** * Opens the host's "Add a source" page; offered when no source fits. Gets * the kind a template's trigger asks for, when it asks for one. */ onAddSource?: ((choice?: EventSourceChoice) => void) | undefined; /** Arguments a new MCP subscription starts with; see `EventTriggersField`. */ argumentDefaults?: Readonly> | undefined; /** Default `AUTOMATION_FREQUENCIES`. */ frequencies?: readonly CadenceFrequency[] | undefined; /** Suggested zones. Default: the viewer's, the schedule's and UTC. */ timeZones?: readonly CadenceTimeZoneOption[] | undefined; /** Default: the browser's zone. */ viewerTimeZone?: string | undefined; /** The clock for previews. */ now?: Date | undefined; /** Notes under the triggers, such as what a run can open. */ children?: ReactNode; disabled?: boolean | undefined; className?: string | undefined; } export declare function AutomationWhenField({ cadence, onCadenceChange, events, onEventsChange, eventTriggers, sources, loadEventTypes, eventIssues, error, sourceLogo, onAddSource, argumentDefaults, frequencies, timeZones, viewerTimeZone, now, children, disabled, className, }: AutomationWhenFieldProps): import("react").JSX.Element;