tuil
ReferencePackages@mwillbanks/tuil-workflowAPI

WorkflowStep

interface exported by @mwillbanks/tuil-workflow.

View rawEdit

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

MemberTypeRequiredDescriptionRelated types
idstring | undefinedNoThe id member uses the string | undefined contract.
titlestring | undefinedNoThe title member uses the string | undefined contract.
componentunknownNoThe component member uses the unknown contract.
helpstring | undefinedNoThe help member uses the string | undefined contract.
when((context: WorkflowContext<TState>) => boolean | Promise<boolean>) | undefinedNoThe 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>) | undefinedNoThe 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>) | undefinedNoThe enter member uses the ((context: WorkflowContext<TState>) => void | Promise<void>) | undefined contract.WorkflowContext
leave((context: WorkflowContext<TState>) => void | Promise<void>) | undefinedNoThe leave member uses the ((context: WorkflowContext<TState>) => void | Promise<void>) | undefined contract.WorkflowContext
compensate((context: WorkflowContext<TState>) => void | Promise<void>) | undefinedNoThe compensate member uses the ((context: WorkflowContext<TState>) => void | Promise<void>) | undefined contract.WorkflowContext
timeoutnumber | undefinedNoThe timeout member uses the number | undefined contract.
commandsreadonly string[] | undefinedNoThe commands member uses the readonly string[] | undefined contract.
operationsreadonly OperationDefinition<unknown>[] | undefinedNoThe operations member uses the readonly OperationDefinition<unknown>[] | undefined contract.OperationDefinition
nestedWorkflowDefinition<unknown> | undefinedNoThe nested member uses the WorkflowDefinition<unknown> | undefined contract.WorkflowDefinition
parallelreadonly (((context: WorkflowContext<TState>) => unknown | Promise<unknown>) | WorkflowParallelBranch<TState>)[] | undefinedNoThe 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.

Source

View the secondary source reference

Package

@mwillbanks/tuil-workflow

On this page