import { Observable } from 'rxjs'; import * as i0 from "@angular/core"; /** * Workflow step states */ export type WorkflowStep = 'idle' | 'selection' | 'loading' | 'processing' | 'summary' | 'review' | 'complete' | 'error'; /** * Component state */ export interface ComponentState { /** Component identifier */ id: string; /** Current state */ state: 'idle' | 'loading' | 'ready' | 'error' | 'disabled'; /** Optional error message */ error?: string; /** Optional data payload */ data?: unknown; /** Last updated timestamp */ updatedAt: Date; } /** * Component state change event */ export interface ComponentStateChange { /** Component identifier */ componentId: string; /** Previous state */ previousState: ComponentState | undefined; /** Current state */ currentState: ComponentState; } /** * Workflow context data */ export interface WorkflowContext { /** Current proposal number */ proposalNo?: string; /** Selected services for summary */ selectedServices?: string[]; /** AI model being used */ selectedModel?: string; /** Summary type */ summaryType?: 'quick' | 'detailed'; /** Any additional context data */ metadata?: Record; } /** * Service for orchestrating workflow state and component communication. * * @example * ```typescript * export class MyComponent { * private workflow = inject(WorkflowOrchestrationService); * * ngOnInit() { * // Register component * this.workflow.registerComponent('my-component', { * id: 'my-component', * state: 'idle', * updatedAt: new Date() * }); * * // Listen to step changes * this.workflow.stepChanged$.subscribe(step => { * console.log('Workflow step:', step); * }); * } * * onAction() { * this.workflow.transitionTo('processing'); * } * } * ``` */ export declare class WorkflowOrchestrationService { /** Current workflow step */ private readonly _currentStep; /** Previous workflow step */ private readonly _previousStep; /** Component states map */ private readonly _componentStates; /** Workflow context */ private readonly _context; /** Step change subject */ private readonly _stepChangedSubject; /** Component state change subject */ private readonly _componentStateChangedSubject; /** Observable for step changes */ readonly stepChanged$: Observable; /** Observable for component state changes */ readonly componentStateChanged$: Observable; /** Current workflow step (readonly) */ readonly currentStep: import("@angular/core").Signal; /** Previous workflow step (readonly) */ readonly previousStep: import("@angular/core").Signal; /** Current workflow context (readonly) */ readonly context: import("@angular/core").Signal; /** Whether workflow is in a loading state */ readonly isLoading: import("@angular/core").Signal; /** Whether workflow is in an error state */ readonly isError: import("@angular/core").Signal; /** Whether workflow is complete */ readonly isComplete: import("@angular/core").Signal; /** * Transition to a new workflow step * @param step - The step to transition to */ transitionTo(step: WorkflowStep): void; /** * Go back to the previous step */ goBack(): void; /** * Reset workflow to initial state */ reset(): void; /** * Register a component with the workflow * @param id - Component identifier * @param initialState - Initial component state */ registerComponent(id: string, initialState: Omit): void; /** * Unregister a component from the workflow * @param id - Component identifier */ unregisterComponent(id: string): void; /** * Update a component's state * @param id - Component identifier * @param update - Partial state update */ updateComponentState(id: string, update: Partial>): void; /** * Get a component's current state * @param id - Component identifier * @returns ComponentState or undefined */ getComponentState(id: string): ComponentState | undefined; /** * Get all component states * @returns Map of component states */ getAllComponentStates(): Map; /** * Check if all specified components are in a certain state * @param componentIds - List of component IDs * @param state - State to check * @returns Boolean */ areComponentsInState(componentIds: string[], state: ComponentState['state']): boolean; /** * Update workflow context * @param update - Partial context update */ updateContext(update: Partial): void; /** * Set the proposal number in context * @param proposalNo - Proposal number */ setProposalNo(proposalNo: string): void; /** * Set selected services in context * @param services - List of service IDs */ setSelectedServices(services: string[]): void; /** * Set the selected AI model in context * @param model - Model name */ setSelectedModel(model: string): void; /** * Clear workflow context */ clearContext(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }