/** * Templates on screen: the tile that tells a template's kind at a glance, the * list a person picks one from, and the dialog that saves an automation as a * template or renames one. Controlled; the host reads and writes templates. */ import { type ReactNode } from "react"; import { type LogoTileSize } from "../../ui/logo-tile.js"; import { type AutomationTemplate } from "./automation-template-model.js"; import { type EventSourceLogoResolver } from "./event-source-tile.js"; export interface AutomationTemplateTileProps { template: AutomationTemplate; sourceLogo?: EventSourceLogoResolver | undefined; /** The host's own art for this template. */ icon?: ReactNode | undefined; size?: LogoTileSize | undefined; } /** * The tile for a template: the app its first event comes from, or a calendar * for one that runs on a schedule. `icon` replaces it, for a host's own art. */ export declare function AutomationTemplateTile({ template, sourceLogo, icon, size, }: AutomationTemplateTileProps): import("react").JSX.Element; export interface AutomationTemplateListProps { /** Names the list for assistive technology: "Templates". */ label: string; templates: readonly AutomationTemplate[]; /** Opens the form filled in from the template. */ onUse: (template: AutomationTemplate) => void; /** * The form's address for a template, so a row is a link that can open in * a new tab; a plain click still calls `onUse`. */ href?: ((template: AutomationTemplate) => string) | undefined; sourceLogo?: EventSourceLogoResolver | undefined; /** A host's own tile for a template, by id. */ icon?: ((template: AutomationTemplate) => ReactNode | undefined) | undefined; /** Menu items for one template, such as Rename and Delete; none for a template without any. */ menu?: ((template: AutomationTemplate) => ReactNode | undefined) | undefined; /** The menu button's accessible name. */ menuLabel?: ((template: AutomationTemplate) => string) | undefined; now: Date; } /** * Templates as a catalog to pick from: what each does, in up to two lines, * and when it runs. Opening one uses it. */ export declare function AutomationTemplateList({ label, templates, onUse, href, sourceLogo, icon, menu, menuLabel, now, }: AutomationTemplateListProps): import("react").JSX.Element; export interface AutomationTemplateDialogProps { open: boolean; onOpenChange: (open: boolean) => void; /** Save an automation as a new template, or rename a saved one. */ mode: "save" | "rename"; /** The name and description it opens with. */ initial: { name: string; description: string; }; /** Saves; a thrown error shows in the dialog and keeps it open. */ onSubmit: (values: { name: string; description: string; }) => Promise; } /** The name and description of a template, to save one or rename it. */ export declare function AutomationTemplateDialog({ open, onOpenChange, mode, initial, onSubmit, }: AutomationTemplateDialogProps): import("react").JSX.Element;