import React from "react"; import type { LayoutProps } from "../WorkflowLayout"; import type { WorkflowIcon } from "./index"; export interface BaseWorkflowProps { heading: string; } interface Developer { contactUrl: string; name: string; } interface BaseWorkflowConfiguration { /** * Team name and contact url, which will be displayed in the case of errors to * allow contact of the owning developer. */ developer: Developer; /** * The name of the workflow which will be displayed in the UI. */ displayName: string; /** * The name of the group which will display in the sidebar. */ group: string; /** * The path (subordinate to the group) where the workflow will exist. * (optionally) use "" to override the landing page, will need to also update the route path */ path: string; /** * The routes correspond to different tasks in a workflow (i.e. for AWS EC2, * users could `reboot instance` or `terminate instance`). */ routes: unknown; } interface WorkflowShortlinkConfiguration { /** * (Optional) property to enable a workflow to utilize short linking of its state. * This property is required to show the short link generator in the header */ shortLink?: boolean; } interface WorkflowLayoutConfiguration { /** * (Optional) property to pass the defined layout properties to all of its defined routes */ defaultLayoutProps?: Omit; } export interface Workflow extends BaseWorkflowConfiguration, WorkflowShortlinkConfiguration, WorkflowLayoutConfiguration { /** * An optional property that is set via the config and allows for the display of an icon given a path, * this will override the default avatar. * { path: string } */ icon?: WorkflowIcon; /** * Configured routes allow for the optional properties of `trending` (whether to display * on homepage) and `componentProps` which allow the passing of workflow/route * specific props. */ routes: ConfiguredRoute[]; } export interface WorkflowConfiguration extends BaseWorkflowConfiguration, WorkflowShortlinkConfiguration, WorkflowLayoutConfiguration { shortLink?: boolean; routes: { [key: string]: Route; }; } export interface Route { component: React.FC; description: string; displayName?: string; /** (optionally) use "" to override the landing page */ path: string; /** Properties required by the Component that are set only via the config. */ requiredConfigProps?: string[]; /** Is the workflow discoverable via search and drawer navigation. This defaults to false. */ hideNav?: boolean; /** * The feature flag used to determine if the route should be registered. * * If this is not set the route will always be registered. */ featureFlag?: string; /** * (Optional) property to define layout properties for a single route */ layoutProps?: Omit; } export interface ConfiguredRoute extends Route { componentProps?: object; trending?: boolean; } interface ErrorBoundaryProps { workflow: Workflow; } interface ErrorBoundaryState { error: Error; errorInfo: React.ErrorInfo; showDetails: boolean; } declare class ErrorBoundary extends React.Component { constructor(props: { workflow: Workflow; }); componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void; onDetailsClose(): void; onDetailsOpen(): void; render(): React.ReactNode; } export default ErrorBoundary; //# sourceMappingURL=workflow.d.ts.map