import type { ReactNode } from 'react'; import type { LunaticComponentDefinition } from '../type'; import { type DeepTranslateExpression } from './fill-components/fill-component-expressions'; import { ComponentPairWiseLinksDefinition } from '../../type.source'; export type ComponentDefinition = LunaticComponentDefinition; export type InterpretedComponent = DeepTranslateExpression; export type InterpretedLoopComponent = DeepTranslateExpression; export type InterpretedRoundaboutComponent = DeepTranslateExpression; export type InterpretedQuestionComponent = DeepTranslateExpression; export type InterpretedPairwiseLinksComponent = DeepTranslateExpression; /** Whether the component has a response attribute. */ export declare function hasResponse(component: unknown): component is { response: { name: string; }; }; /** Whether the component has a responses attribute. */ export declare function hasResponses(component: unknown): component is { responses?: Array<{ label: ReactNode; description?: ReactNode; response: { name: string; }; }>; }; /** Whether the component has a body attribute. */ export declare function hasBody(component: unknown): component is { body: LunaticComponentDefinition<'Table'>['body']; }; /** Whether the component has a componentType attribute. */ export declare function hasComponentType(component: unknown): component is { componentType: string; }; /** Whether the component is a Loop or a RosterForLoop. */ export declare function isLoopComponent(component: ComponentDefinition | InterpretedComponent): component is InterpretedLoopComponent; /** Whether the component is a Roundabout. */ export declare function isRoundaboutComponent(component: ComponentDefinition | InterpretedComponent): component is InterpretedRoundaboutComponent; /** Whether the component is a Question. */ export declare function isQuestionComponent(component: ComponentDefinition | InterpretedComponent): component is InterpretedQuestionComponent; /** Whether the component is a PairwiseLinks. */ export declare function isPairwiseLinksComponent(component: ComponentDefinition | InterpretedComponent): component is ComponentPairWiseLinksDefinition; /** * Get the pairwise component if it exists. * * There should only be one so we return the first one we find. */ export declare function getPairwiseComponent(components: ComponentDefinition[]): ComponentPairWiseLinksDefinition | undefined;