import { BaseSectionDefinition, BaseSectionDefinitionOptions } from './BaseSectionDefinition.js'; import { FieldSubSectionDefinition } from './FieldSubSectionDefinition.js'; import { SectionType } from './SectionTypeEnum.js'; /** * Options for initializing a FieldSectionDefinition. */ export interface FieldSectionDefinitionOptions extends BaseSectionDefinitionOptions { /** * Indicates if the data generator (tdg) column is mandatory. * Default is false. */ tdgMandatory?: boolean; /** * Indicates if the section must have at least one value. * Default is true. */ mandatory?: boolean; } /** * Represents the main data section of a decision table. * * A FieldSectionDefinition is the most important section in a decision table, * as it contains the relevant data divided into one or more sub-sections. * Each sub-section is represented by a FieldSubSectionDefinition and is stored * in the 'subSections' mapping using its header row as the key. */ export declare class FieldSectionDefinition extends BaseSectionDefinition { /** * The section type is set to FIELD_SECTION. */ sectionType: SectionType; /** * A mapping of sub-section IDs to their corresponding FieldSubSectionDefinition. */ subSections: Record; /** * Indicates whether the data generator (tdg) column is mandatory. * Default is false. */ tdgMandatory: boolean; /** * Indicates whether the section must have at least one value. * Default is true. */ mandatory: boolean; /** * Getter for the data row IDs of this section. * Returns the underlying _dataRows array. */ get dataRows(): string[]; /** * Setter for the data row IDs of this section. * Updates the underlying _dataRows array. */ set dataRows(value: string[]); /** * Constructs a new FieldSectionDefinition. * * Initializes the field section with options provided, including whether the section is mandatory * and whether the data generator column is mandatory. * * @param opts - Options for initializing the field section. */ constructor(opts: FieldSectionDefinitionOptions); /** * Validates the field section definition. * * This method checks that the section has at least one sub-section. * If no sub-sections exist, an error issue is added to the returned array. * Otherwise, it iterates over each sub-section and invokes its validate method. * * @returns An array of validation issues found. */ validate(): import("../index.js").SectionErrorInterface[]; /** * Creates a new data row for this field section. * * Since a field section contains sub-sections, this method creates a new field by calling createNewField * and returns the header row ID of the newly created sub-section. * * @returns The header row ID of the newly created field. */ createNewRow(): string; /** * Adds a new empty field to the section. * * This method creates a new FieldSubSectionDefinition with an optional field name, * assigns the header row of the new field as its identifier, adds it to the subSections mapping, * and appends its header row to the dataRows array. It also sets the parent of the sub-section to the * header row of the field section. * * @param fieldName - (Optional) The name for the new field. * @returns The newly created FieldSubSectionDefinition. */ createNewField(fieldName?: string): FieldSubSectionDefinition; } //# sourceMappingURL=FieldSectionDefinition.d.ts.map