import { SectionErrorInterface, SectionInterface } from '../interface/SectionInterface.js'; import { SectionType } from './SectionTypeEnum.js'; /** * Options for initializing a BaseSectionDefinition. */ export interface BaseSectionDefinitionOptions { /** * The name of this section. */ name?: string; /** * An identifier used to identify the header row of the section. * (FIXME: Consider renaming to headerRowId) */ headerRow?: string; } /** * Base class for all sections used in a decision table. * * A decision table is divided into different sections, each providing specific functionality. * This base class implements common properties and methods shared by all sections. */ export declare class BaseSectionDefinition implements SectionInterface { /** * The type of the section. * Subclasses should override this property. */ sectionType: SectionType; /** * The name of this section. */ name?: string; /** * Indicates whether the section is mandatory (i.e., must have at least one value). */ mandatory: boolean; /** * Indicates whether the section supports multiple data rows. */ multiple: boolean; /** * The identifier for the header row of the section. * (FIXME: Consider renaming to headerRowId) */ headerRow: string; /** * Stores the IDs of the data rows for this section. */ protected _dataRows: string[]; /** * If set to false, only one instance of this section type is allowed per model. */ multiInstancesAllowed: boolean; /** * Constructs a new BaseSectionDefinition. * * @param opts - Options for initializing the section, including an optional name and header row identifier. */ constructor(opts: BaseSectionDefinitionOptions); /** * Gets the data row IDs for this section. * * @returns An array containing the IDs of the data rows. */ get dataRows(): string[]; /** * Sets the data row IDs for this section. * * @param value - The new array of data row IDs. */ set dataRows(value: string[]); /** * Determines if a given row ID corresponds to the header row. * * @param rowid - The row ID to check. * @returns True if the provided row ID is the header row; otherwise, false. */ isHeader(rowid: string): boolean; /** * Creates a new data row for this section. * * If the section supports multiple rows, a new UUID is generated, added to the * data rows array, and returned. * * @returns The newly created row ID. * @throws Error if the section does not support multiple rows. */ createNewRow(): string; /** * Retrieves all row IDs associated with this section. * * If the section supports multiple rows, returns an array containing the header row and all data rows. * Otherwise, returns an array containing only the header row. * * @returns An array of row IDs. */ getRowIds(): string[]; /** * Validates the section definition. * * Currently, validation checks that the section has a defined name. * * @returns An array of validation issues, each conforming to SectionErrorInterface. */ validate(): SectionErrorInterface[]; } //# sourceMappingURL=BaseSectionDefinition.d.ts.map