UNPKG

@microsoft/windows-admin-center-sdk

Version:

Microsoft - Windows Admin Center Shell

56 lines (55 loc) 1.89 kB
import { PersistentWorkItem } from './persistent-work-item'; import { PersistentWorkflow } from './persistent-workflow'; import { PersistentWorkflowContext } from './persistent-workflow-context'; declare type PersistentDataType = any; declare type TransitDataType = any; declare type PersistentContextType = PersistentWorkflowContext<TransitDataType, PersistentDataType>; declare type PersistentWorkItemType = PersistentWorkItem<PersistentContextType>; /** * Abstract class of workflow builder. * An instance of this class will be used to build workflow. */ export declare abstract class PersistentWorkflowBuilder { protected moduleName: string; protected name: string; protected version: number; /** * The collection of work items. */ protected collection: PersistentWorkItem<any>[]; /** * Initializes a new instance of the PersistentWorkflowBuilder abstract class. * * @param moduleName the module name. * @param name the name within the namespace. * @param version the version number. */ constructor(moduleName: string, name: string, version: number); /** * Initializes the collection to before adding any work items. */ protected init(): void; /** * Gets the workflow. */ protected get workflow(): PersistentWorkflow; /** * Add the work item single sequence pattern. * * @param workItem the work item. */ protected addSequence<TRequest, TResult>(workItem: PersistentWorkItemType): void; /** * Add the work item with custom sequence. * * @param workItem the work item. */ protected add<TRequest, TResult>(workItem: PersistentWorkItemType): void; /** * Build the collection of work item for workflow. * * @returns the collection of work items. */ abstract build(): PersistentWorkflow; } export {};