import { TableDecision } from '../../model-decision/index.js'; import { ParserBase } from './ParserBase.js'; import type { TableInterface } from '../../model/index.js'; import type { ImporterInterface } from '../../importer-xlsx/index.js'; import type { ParserParseRequest } from './ParserInterface.js'; interface SectionHandlerOptions { table: TableDecision; sheetName: string; importer: ImporterInterface; sectionName: string; startRow: number; endRow: number; testCaseEndColumn: number; } type SectionHandler = (opts: SectionHandlerOptions) => void; interface NextSectionResult { startRow: number; endRow: number; sectionType: string; } interface NextSubSectionResult { startRow: number; endRow: number; fieldName: string; } /** * The parser implementation to parse decision tables. */ export declare class ParserDecision extends ParserBase { /** This sequence is used to give each field a unique name. */ fieldNameSequence: number; sectionHandler: Record; /** * Parses the sheet with the given name und uses the given importer to access * the data. * @param request - The parameters as defined in @see ParserParseRequest * @returns The created table model */ parse(request: ParserParseRequest): TableInterface | undefined; /** * Creates a unique field name. * @returns the new generated fieldName */ getFieldName(): string; /** * Reads the first line until no testcase name found. This * column is the last column which will be read. By the way create emtpy testcases * and add them to the table. * @param request - The parameter as defined * @returns The testcase end column */ parseForTestcases(request: { /** The table object. The new model */ table: TableDecision; /** The name of the worksheet */ sheetName: string; /** The importer */ importer: ImporterInterface; /** The coumn in which the testcases starts */ testCaseStartColumn: number; /** The row in which the testcase names are defined */ startRow: number; }): number; /** * After the table was loaded it must be checked if there is a 'ExecuteSection'. * If so the values must be set in the testcase.execute property * @param table - The table to be updated */ private updateTestcaseExecute; /** * After the table was loaded it must be checked if there is a 'ExecuteSection'. * If so the values must be set in the testcase.execute property * @param table - The table to be updated */ private updateTestcaseNeverExecute; /** * Converts a string value into a boolen value * @param val - The value to be checked for a boolean * @returns true is the string is a true value else false */ private getBoolean; /** * If this section exists the multiplicity of an testcase must be updated * @param table - The table to be updated */ private updateTestcaseMultiplicity; /** * Tries to convert a string into a multiplicity value * @param val - The value to be checked for number * @returns The number. If the string could not be parsed it will return 1 */ private getMultiplicityFromValue; /** * Adds a new MultiRowSection to the table. Updates the data for all the testcases * @param opts - The parameter as defined in @see SectionHandlerOptions */ handleMultiRowSection(opts: SectionHandlerOptions): void; /** * Adds a new TagSection to the table. Updates the data for all the test cases * @param opts - The parameter as defined in @see SectionHandlerOptions */ handleTagSection(opts: SectionHandlerOptions): void; /** * Adds a new TagSection to the table. Updates the data for all the test cases * @param opts - The parameter as defined in @see SectionHandlerOptions */ handleFilterSection(opts: SectionHandlerOptions): void; /** * Adds a new GeneratorSwitch to the table. Updates the data for all the test cases * @param opts - The parameter as defined in @see SectionHandlerOptions */ handleGeneratorSwitchSection(opts: SectionHandlerOptions): void; /** * Adds a new SummarySection to the table. Updates the data for all the testcases * @param opts - The parameter as defined in @see SectionHandlerOptions */ handleMultiplicitySection(opts: SectionHandlerOptions): void; /** * Adds a new ExecuteSection to the table. Updates the data for all the testcases * @param opts - The parameter as defined in @see SectionHandlerOptions */ handleExecuteSection(opts: SectionHandlerOptions): void; /** * Adds a new NeverExecuteSection to the table. Updates the data for all the testcases * @param opts - The parameter as defined in @see SectionHandlerOptions */ handleNeverExecuteSection(opts: SectionHandlerOptions): void; /** * Adds a new SummarySection to the table. Updates the data for all the testcases * @param opts - The parameter as defined in @see SectionHandlerOptions */ handleSummarySection(opts: SectionHandlerOptions): void; /** * Adds a new FieldSection to the table. Updates the data for all the testcases * @param opts - The parameter as defined in @see SectionHandlerOptions */ handleFieldSection(opts: SectionHandlerOptions): void; /** * reads the data for the testcases from the spreadsheet * @param request - The parameters as defined */ private readTestcaseValues; /** * Get the definition of the next sub section * @param request - The parameter as defined * @returns A definition/boundaries of this subSection \{ startRow, endRow, fieldName \} */ getNextSubSection(request: { /** The name of the sheet */ sheetName: string; /** The importer */ importer: ImporterInterface; /** The row where to start searching */ startRow: number; /** The last row in the parent section */ sectionEndRow: number; }): NextSubSectionResult; /** * Get the definition of the next section * @param request - The parameter as defined * @returns The created table model for the sheet */ getNextSection(request: { /** The name of the sheet */ sheetName: string; /** The importer */ importer: ImporterInterface; /** The row where to start searching */ startRow: number; /** The last row in this sheet */ sheetEndRow: number; }): NextSectionResult; } export {}; //# sourceMappingURL=ParserDecision.d.ts.map