WorkflowStep
interface exported by @mwillbanks/tuil-workflow.
interface
Public interface exported by @mwillbanks/tuil-workflow.
export interface WorkflowStep<TState> {
readonly id?: string;
readonly title?: string;
readonly component?: unknown;
readonly help?: string;
readonly when?: (
context: WorkflowContext<TState>,
) => boolean | Promise<boolean>;
readonly validate?: (
context: WorkflowContext<TState>,
) =>
| string
| readonly string[]
| undefined
| Promise<string | readonly string[] | undefined>;
readonly enter?: (context: WorkflowContext<TState>) => void | Promise<void>;
readonly leave?: (context: WorkflowContext<TState>) => void | Promise<void>;
readonly compensate?: (
context: WorkflowContext<TState>,
) => void | Promise<void>;
readonly timeout?: number;
readonly commands?: readonly string[];
readonly operations?: readonly OperationDefinition[];
readonly nested?: WorkflowDefinition<unknown>;
readonly parallel?: readonly (
| ((context: WorkflowContext<TState>) => unknown | Promise<unknown>)
| WorkflowParallelBranch<TState>
)[];
}Members
| Member | Type | Required | Description | Related types |
|---|---|---|---|---|
id | string | undefined | No | The id member uses the string | undefined contract. | — |
title | string | undefined | No | The title member uses the string | undefined contract. | — |
component | unknown | No | The component member uses the unknown contract. | — |
help | string | undefined | No | The help member uses the string | undefined contract. | — |
when | ((context: WorkflowContext<TState>) => boolean | Promise<boolean>) | undefined | No | The when member uses the ((context: WorkflowContext<TState>) => boolean | Promise<boolean>) | undefined contract. | WorkflowContext |
validate | ((context: WorkflowContext<TState>) => string | readonly string[] | undefined | Promise<string | readonly string[] | undefined>) | undefined | No | The validate member uses the ((context: WorkflowContext<TState>) => string | readonly string[] | undefined | Promise<string | readonly string[] | undefined>) | undefined contract. | WorkflowContext |
enter | ((context: WorkflowContext<TState>) => void | Promise<void>) | undefined | No | The enter member uses the ((context: WorkflowContext<TState>) => void | Promise<void>) | undefined contract. | WorkflowContext |
leave | ((context: WorkflowContext<TState>) => void | Promise<void>) | undefined | No | The leave member uses the ((context: WorkflowContext<TState>) => void | Promise<void>) | undefined contract. | WorkflowContext |
compensate | ((context: WorkflowContext<TState>) => void | Promise<void>) | undefined | No | The compensate member uses the ((context: WorkflowContext<TState>) => void | Promise<void>) | undefined contract. | WorkflowContext |
timeout | number | undefined | No | The timeout member uses the number | undefined contract. | — |
commands | readonly string[] | undefined | No | The commands member uses the readonly string[] | undefined contract. | — |
operations | readonly OperationDefinition<unknown>[] | undefined | No | The operations member uses the readonly OperationDefinition<unknown>[] | undefined contract. | OperationDefinition |
nested | WorkflowDefinition<unknown> | undefined | No | The nested member uses the WorkflowDefinition<unknown> | undefined contract. | WorkflowDefinition |
parallel | readonly (((context: WorkflowContext<TState>) => unknown | Promise<unknown>) | WorkflowParallelBranch<TState>)[] | undefined | No | The parallel member uses the readonly (((context: WorkflowContext<TState>) => unknown | Promise<unknown>) | WorkflowParallelBranch<TState>)[] | undefined contract. | WorkflowContext, WorkflowParallelBranch |
Parameters
This declaration has no public members.
Returns
This declaration does not return a value.
Throws
No thrown errors are documented for this declaration.
Related types
Source
View the secondary source reference