import { default as React } from 'react'; import { BuiltInFieldDefinition } from './built-in-fields'; import { DatasourcePlugin, CustomParameterPlugin, ReportBuilderState, ReportTemplate, AvailableSubReport } from './report-builder-types'; import { ReportBuilderStore } from './report-builder-store'; export interface ReportBuilderContextValue { store: ReportBuilderStore; datasourcePlugins: DatasourcePlugin[]; parameterPlugins: CustomParameterPlugin[]; availableSubReports: AvailableSubReport[]; /** Fully merged list of built-in fields (library registry + per-instance overrides). */ builtInFields: BuiltInFieldDefinition[]; templates: ReportTemplate[]; onSaveTemplate?: (template: ReportTemplate) => void; onDeleteTemplate?: (templateId: string) => void; onLoadTemplate?: (template: ReportTemplate) => void; } export declare const ReportBuilderContext: React.Context; export declare function useReportBuilderContext(): ReportBuilderContextValue; /** * Subscribe to the report-builder store with an optional selector. * * Pass `shallow = true` as the second argument when the selector returns a freshly-built * array or object derived from state — e.g. `s.definition.variables ?? []` or * `Object.values(s.datasources)`. Without shallow comparison a new reference would fire a * re-render on every store change even when the underlying values are unchanged; with it, * the hook compares element-by-element and only re-renders on real differences. * * Reference-stable selectors (`s.definition.components`, `s.selectedItemId`) don't need it. */ export declare function useRBStore(): ReportBuilderState; export declare function useRBStore(selector: (s: ReportBuilderState) => R, shallow?: boolean): R;