import type { BindingErrorsType, BindingHeaderObjectType, BindingRowItemType, ErrorRowType, FileObjectType, ParserDataObjectType, ValidateRowReturnType } from '../../types'; /** * Excel Parser Instance * * Desc: Read, Parse and Validation Excel file * * the value of the parameter 'hasHeader/isHeader' * is specified depending on whether the file has a header */ declare class Parser { /** * Represents whether a given block of code or element is a header. */ private isHeader; /** * Represents a file object. */ private file; /** * Represents an array of ParserDataObjectType. */ private data; /** * Represents the original data in the form of an array of ParserDataObjectType. */ private originalData; /** * Represents the data for binding rows. */ private bindData; /** * Represents an array of binding errors. */ private errors; /** * Constructor * * @param hasHeader */ constructor(hasHeader?: boolean); /** * Checks if the object has a header. */ get hasHeader(): boolean; /** * Set whether the header is enabled or disabled. */ set hasHeader(val: boolean); /** * Checks if the object has an original file. */ get hasOriginalFile(): FileObjectType; /** * Retrieves the accepted file types for uploading in the application. */ getFileAccept(): string; /** * Sets the header value. */ setHeader(val: boolean): void; /** * Retrieves the data in a normalized format. */ getData(): Array; /** * Sets the data for the object. */ setData(data: Array): void; /** * Retrieves the original data from the parser. */ getOriginalData(): Array; /** * Sets the original data for the parser. */ setOriginalData(data: Array): void; /** * Retrieves the binding data. */ getBindData(): Array; /** * Sets the bind data for the method. */ setBindData(data: Array): void; /** * Sets the errors for the current instance. */ setError(errors: Array): void; /** * Retrieves the errors associated with the current instance. */ getErrors(): Array; /** * Checks if there are any errors present in the object. */ hasErrors(): boolean; /** * Check if the given index is a valid index within the bindData array. */ _isValidIndex(index: number): boolean; /** * Deletes the error at the specified index. */ _deleteError(index: number): void; /** * Reads the content of a file and returns parsed data. */ readFile(file: File): Promise<{ data: Array; }>; /** * Parsed the data in the specified sheet based on the provided row header index. */ reparseHeadRowData(sheetIndex: number, rowHeader: number): Promise<{ data: Array; }>; /** * Binds columns from sheet data to header data. */ bindColumns(index: number, headerData: Array): Promise<{ result: Array; errors: Array; }>; /** * Validates the binding data using the given header options. */ validateBindData(headerOptions: Array): Array; /** * Updates the error row in the "errors" array based on the given parameters. */ updateErrorRow(row: number, errorRows: Array, valid: boolean): void; /** * Validates a row of data based on the provided header options. */ validateRow(index: number, headerOptions: Array): ValidateRowReturnType; /** * Updates a row in the binding data at the specified index. */ updateRow(rowIndex: number, row: BindingRowItemType, headerOptions: Array): BindingRowItemType; /** * Deletes a row from the bindData array at the specified index. */ deleteRow(rowIndex: number): void; resetData(): void; } export default Parser;