import { ITransactionOperation } from './Transactions'; import { Observable } from 'rxjs'; export interface IWizardStepSource { load(params: Params): Promise; } export declare class WizardStepSource implements IWizardStepSource { private readonly inner; constructor(inner: (params: Params) => Promise); load(params: Params): Promise; } export interface UpdateWizardState { property: string; value: any; previous: any; } export interface IWizardStep { reset(): void; resetState(params: Params): Promise; buildOperation(wizard: IWizard): ITransactionOperation; isDirty(): boolean; changes$: Observable; initialized$: Observable; key: string; } export interface WizardStepOptions { key: string; source: IWizardStepSource; defaultValue: Model; operation: IWizardOperation; } export interface IWizardOperationContext { values: Partial; changes: UpdateWizardState[]; current: Model; wizard: IWizard; params: Params; } export interface IWizardOperation { execute(context: IWizardOperationContext): Promise; } export declare class WizardStep implements IWizardStep { private readonly options; private readonly current; private readonly initialized; private readonly previous; constructor(options: WizardStepOptions); get key(): string; get changes$(): Observable; get initialized$(): Observable; get model(): Model; get previousModel(): Model | undefined; rollbackToPrevious(): void; save(value: Model): void; resetState(params: Params): Promise; buildOperation(wizard: IWizard): ITransactionOperation; isDirty(): boolean; resolveChanges(): UpdateWizardState[]; createPatchModel(): Partial; reset(): void; } export interface IWizard { steps: IWizardStep[]; } export declare class Wizard implements IWizard { readonly steps: IWizardStep[]; private readonly current; private readonly isStarted; private readonly params; constructor(steps: IWizardStep[]); start(params: Params): Promise; selectStep(key: keyof State): void; findStep(key: keyof State): IWizardStep | undefined; get params$(): Observable; get current$(): Observable | undefined>; get initialized$(): Observable; get isStarted$(): Observable; commit(): Promise; commitStep(key: keyof State): Promise; resetAll(): void; updateParams(params: Params): void; save(): Promise; } export declare function diffState(a: T, b: T): UpdateWizardState[]; declare type CreateWizardExpression = { [Property in keyof State]: WizardStepOptions; } & { onStart?: (params: Params) => Promise; }; export declare function createWizard(expression: CreateWizardExpression): Wizard; export {};