tuil
ReferencePackages@mwillbanks/tuil-operationsAPI

OperationDefinition

interface exported by @mwillbanks/tuil-operations.

View rawEdit

interface

Public interface exported by @mwillbanks/tuil-operations.

export interface OperationDefinition<TResult = unknown> {
  readonly id: string;
  readonly title: string;
  readonly description?: string;
  readonly metadata?: Readonly<Record<string, unknown>>;
  readonly retries?: number;
  readonly retryDelay?: number;
  readonly timeout?: number;
  readonly run: (context: OperationContext) => TResult | Promise<TResult>;
  readonly rollback?: OperationRollback<TResult>;
}

Members

MemberTypeRequiredDescriptionRelated types
idstringYesThe id member uses the string contract.
titlestringYesThe title member uses the string contract.
descriptionstring | undefinedNoThe description member uses the string | undefined contract.
metadataReadonly<Record<string, unknown>> | undefinedNoThe metadata member uses the Readonly<Record<string, unknown>> | undefined contract.
retriesnumber | undefinedNoThe retries member uses the number | undefined contract.
retryDelaynumber | undefinedNoThe retryDelay member uses the number | undefined contract.
timeoutnumber | undefinedNoThe timeout member uses the number | undefined contract.
run(context: OperationContext) => TResult | Promise<TResult>YesThe run member uses the (context: OperationContext) => TResult | Promise<TResult> contract.OperationContext
rollback((result: TResult | undefined, context: OperationContext) => void | Promise<void>) | undefinedNoThe rollback member uses the ((result: TResult | undefined, context: OperationContext) => void | Promise<void>) | undefined contract.OperationContext

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-operations

On this page