@uplink-protocol/form-controller
Version:
Reactive multi-step form controller with dynamic validation and state management
36 lines (35 loc) • 1.74 kB
TypeScript
import { StepperService } from './stepper.service';
import { InteractionService } from './interaction.service';
import { FieldService } from './field.service';
import { ConfigService } from './config.service';
import { FormStep } from '../interfaces/form-step.interface';
/**
* NavigationManager - Handles complex navigation operations with validation and binding updates
* This provides a higher-level abstraction for navigation operations
*/
export declare class NavigationManager {
private stepperService;
private configService;
private fieldService;
private interactionService;
constructor(stepperService: StepperService, configService: ConfigService, fieldService: FieldService, interactionService: InteractionService);
/**
* Navigate to the next step with validation
* @param updateBindings Function to update binding values after navigation
* @returns New step index or current step if navigation isn't possible
*/
goToNextWithValidation(updateBindings: (newIndex: number, step: FormStep | null) => void): number;
/**
* Navigate to the previous step
* @param updateBindings Function to update binding values after navigation
* @returns New step index or current step if navigation isn't possible
*/
goToPrevious(updateBindings: (newIndex: number, step: FormStep | null) => void): number;
/**
* Navigate to a specific step by index
* @param stepIndex Target step index
* @param updateBindings Function to update binding values after navigation
* @returns True if navigation succeeded, false otherwise
*/
goToSpecificStep(stepIndex: number, updateBindings: (newIndex: number, step: FormStep | null) => void): boolean;
}