import { components } from '../../../types/api'; import DataTableBuilder from '../../DataTableBuilder/DataTableBuilder'; import { ReportTemplateData } from '../SectionedDataHelper/types'; import { TemplateBuilder } from '../TemplateBuilder'; import { ChildData, GroupedParentChildDataset, ParentChildTableData, ParentChildDataset } from './types'; export declare class ParentChildDataBuilder extends TemplateBuilder { childColumns: Array; childVariants: components['schemas']['ChildVariantDefinition'][]; childData: Array; joinFields: Array; childFields: Array; parentChildDatasets: ParentChildDataset[]; dataTableBuilder: DataTableBuilder; constructor(variant: components['schemas']['VariantDefinition'], defId: string); getChildVariant(childId: string): { id: string; name: string; resourceName: string; specification?: components["schemas"]["Specification"] | null; joinFields: string[]; } | undefined; /** * Exracts the relevant data from the child variant definition * to generate the child table * * @param {string} childId * @return { fields: components['schemas']['FieldDefinition'][], joinFields: string[], columns: string[], name: string } * @memberof ParentChildDataBuilder */ getChildVariantDefinitionData(childId: string): { fields: { name: string; display: string; wordWrap?: "none" | "normal" | "break-words" | null; filter?: components["schemas"]["FilterDefinition"] | null; sortable: boolean; defaultsort: boolean; sortDirection?: "asc" | "desc" | null; type: "boolean" | "date" | "double" | "HTML" | "long" | "string" | "time" | "timestamp"; mandatory: boolean; visible: boolean; calculated: boolean; header: boolean; fieldSource: "specfield" | "paramfield"; }[]; joinFields: string[]; columns: string[]; name: string; }; /** * Maps the parent child rows. * Splits into sections that will become the parent table * * @return {*} {GroupedParentChildDataset[]} * @memberof ParentChildDataBuilder */ mergeParentChildAndGroup(parentData: Record[]): GroupedParentChildDataset[]; /** * Maps the parent child data to a table data * * @param {GroupedParentChildDataset[]} parentChildGroups * @return {*} {ParentChildData[]} * @memberof ParentChildDataBuilder */ mapToTableData(parentChildGroups: GroupedParentChildDataset[]): ParentChildTableData[]; /** * Maps the grouped child data to table data * * @param {GroupedParentChildDataset} group * @return {*} * @memberof ParentChildDataBuilder */ mapChildDataToTableData(group: GroupedParentChildDataset): { head: Array | null; rows: Array>; rowCount: number; colCount: number; title: string; }[]; withChildData(childData: Array): this; withChildColumns(childColumns: string[]): this; build(): ReportTemplateData; }