import type { QrRepeatGroup } from './repeatGroup.interface'; import type { QuestionnaireItem, QuestionnaireResponseItem } from 'fhir/r4'; import type { RenderingExtensions } from '../hooks/useRenderingExtensions'; /** * Props interface for components that emit a `QuestionnaireResponseItem` update. * * @property onQrItemChange - Callback function to handle an updated QR item. * - The `qrItem` represents the new or modified item. */ export interface PropsWithQrItemChangeHandler { onQrItemChange: (qrItem: QuestionnaireResponseItem) => unknown; } /** * Props interface for components that emit a `QrRepeatGroup` update. * * @property onQrRepeatGroupChange - Callback function to handle an updated repeating group item. * - The `qrRepeatGroup` represents the entire repeating group structure. */ export interface PropsWithQrRepeatGroupChangeHandler { onQrRepeatGroupChange: (qrRepeatGroup: QrRepeatGroup) => unknown; } export interface PropsWithRenderingExtensionsAttribute { renderingExtensions: RenderingExtensions; } export interface PropsWithIsRepeatedAttribute { isRepeated: boolean; } export interface PropsWithIsTabledAttribute { isTabled: boolean; } export interface PropsWithParentIsReadOnlyAttribute { parentIsReadOnly?: boolean; } export interface PropsWithFeedbackFromParentAttribute { feedbackFromParent?: string; } export interface PropsWithParentIsRepeatGroupAttribute { parentIsRepeatGroup?: boolean; parentRepeatGroupIndex?: number; } export interface PropsWithCalculatedExpressionUpdatedAttribute { calcExpUpdated: boolean; } export interface PropsWithParentStylesAttribute { parentStyles?: Record; } export interface BaseItemProps extends PropsWithQrItemChangeHandler, PropsWithIsRepeatedAttribute, PropsWithIsTabledAttribute, PropsWithRenderingExtensionsAttribute, PropsWithParentIsReadOnlyAttribute, PropsWithFeedbackFromParentAttribute, PropsWithCalculatedExpressionUpdatedAttribute, PropsWithParentStylesAttribute { qItem: QuestionnaireItem; qrItem: QuestionnaireResponseItem | null; }