@uplink-protocol/form-controller
Version:
Reactive multi-step form controller with dynamic validation and state management
46 lines (45 loc) • 2.03 kB
TypeScript
import { ConfigService } from './config.service';
import { FormService } from './form.service';
import { FieldService } from './field.service';
import { InteractionService } from './interaction.service';
import { FormStep } from '../interfaces/form-step.interface';
import { FormConfig } from '../interfaces/form-config.interface';
import { BaseService } from './base.service';
import { StepperService } from './stepper.service';
/**
* ConfigManagerService - Manages configuration operations that require coordination with other services
* This provides a higher-level abstraction for configuration management across the form
*/
export declare class ConfigManagerService {
private configService;
private formService;
private fieldService;
private interactionService;
private fieldErrorsService;
private stepsValidityService;
private stepperService;
constructor(configService: ConfigService, formService: FormService, fieldService: FieldService, interactionService: InteractionService, fieldErrorsService: BaseService<Record<string, Record<string, string>>>, stepsValidityService: BaseService<Record<string, boolean>>, stepperService: StepperService);
/**
* Update form configuration and reset all form state
* @param newConfig New form configuration
*/
updateConfigWithReset(newConfig: FormConfig): void;
/**
* Update config with full reset - handles all reset operations internally
* @param newConfig New form configuration
*/
updateConfigWithFullReset(newConfig: FormConfig): void;
/**
* Add a new step dynamically with updated form data
* @param step New form step
* @param index Position to insert (defaults to end)
* @returns New steps length
*/
addStepWithFormData(step: FormStep, index?: number): number;
/**
* Remove a step dynamically and clean up related state
* @param stepId ID of the step to remove
* @returns Success flag
*/
removeStepWithCleanup(stepId: string): boolean;
}