import { BaseService } from './base.service'; import { ConfigService } from './config.service'; /** * Service for managing form data and submission */ export declare class FormService extends BaseService>> { private configService; private fieldErrorsService; constructor(initialFormData: Record>, configService: ConfigService, fieldErrorsService: BaseService>>, stepsValidityService: BaseService>); /** * Update a field value * @param stepId Step ID * @param fieldId Field ID * @param value New field value */ updateField(stepId: string, fieldId: string, value: any): void; /** * Get form data for a specific step * @param stepId Step ID * @returns Step data or empty object if step doesn't exist */ getStepData(stepId: string): Record; /** * Get all form data * @returns Complete form data */ getAllData(): Record>; /** * Get flattened form data (merged from all steps) * @returns Flattened form data */ getFlatData(): Record; /** * Update a field value and validate it immediately * * @param stepId Step ID * @param fieldId Field ID * @param value New field value * @param markFieldTouched Function to mark the field as touched * @param validateField Function to validate the field * @param validateStepWithTouched Function to validate the step with touched fields only */ updateFieldWithValidation(stepId: string, fieldId: string, value: any, markFieldTouched: (stepId: string, fieldId: string, touched: boolean) => void, validateField: (stepId: string, fieldId: string, value: any, showErrors: boolean) => boolean, validateStepWithTouched: (stepId: string) => boolean): void; /** * Reset form data to initial values and optionally reset related state * * @param defaultValues Optional custom default values * @param resetTouchTracking Function to reset touch tracking state * @param validateForm Function to validate the form */ resetFormWithState(defaultValues?: Record, resetTouchTracking?: () => void, validateForm?: (showErrors: boolean) => boolean): void; /** * Handle form submission logic with integrated validation * @param validateAndMarkTouched Function to validate the entire form and mark fields touched * @param findFirstInvalidStep Function to find the first invalid step * @param goToStep Function to navigate to a step by index * @returns Submission result object */ submitForm(validateAndMarkTouched: () => boolean, findFirstInvalidStep: () => number, goToStep: (index: number) => void): { success: boolean; data?: any; errors?: any; }; /** * Completely reset the form, touch tracking, and validation state * @param resetTouchTracking Function to reset touch tracking * @param validateForm Function to validate the entire form */ completeReset(resetTouchTracking: () => void, validateForm: () => void): void; /** * Get the ConfigService associated with this FormService * @returns The ConfigService instance */ getConfigService(): ConfigService; /** * Reset form data to initial values * @param defaultValues Optional custom default values */ resetForm(defaultValues?: Record): void; }