import type { StructNode } from "../../shared/schema-utils/index.js"; import type { WorkflowOutcomeDataFriendlyNode } from "../../shared/workflow/index.js"; type OutcomeSchema = { [key: string]: WorkflowOutcomeDataFriendlyNode; } | StructNode<{ [key: string]: WorkflowOutcomeDataFriendlyNode; }> | null; type ReservedOutcomeSlug = "catchall_error"; type ReservedOutcomeSlugError = 'Outcome slug "catchall_error" is reserved'; type ExcludeReservedOutcomeSlug = TSlug extends ReservedOutcomeSlug ? ReservedOutcomeSlugError : TSlug; /** * `id` is preferred. `slug` is a deprecated alias. A generic parameter keeps a string literal * intact so `"catchall_error"` is rejected here; a value already typed as `string` is not. */ type OutcomeIdentifierProps = { /** A unique, human-readable identifier for this outcome. Formatted in snake case. */ id: ExcludeReservedOutcomeSlug; } | { /** * @deprecated Use `id` instead. * * A unique, human-readable identifier for this outcome. Formatted in snake case. */ slug: ExcludeReservedOutcomeSlug; }; type OutcomeComponent = (props: TProps & OutcomeIdentifierProps) => React.ReactElement | null; /** * A React component that asserts a possible outcome that a block executor can return. * * Outcomes should always be an object with fields. * * `id` (or the deprecated `slug`) must be unique across this block's outcomes, and must not be * `"catchall_error"`. That slug is reserved for the catch-all error path. */ export type Outcome = OutcomeComponent<{ label?: string; schema: OutcomeSchema; }>; /** * A React component that discloses an error outcome this block can return. * * Disclosure only offers the outcome in the workflow author's error-handling dropdown. It does not * add a canvas path, until the workflow author decides which disclosed errors are handled. * * `id` (or the deprecated `slug`) must be unique across this block's outcomes, including success * outcomes. */ export type ErrorOutcome = OutcomeComponent<{ /** Label shown in the workflow author's error-handling dropdown. */ label: string; schema: OutcomeSchema; }>; export {}; //# sourceMappingURL=outcome.d.ts.map