import type { ComponentDefinition, ComponentRoundaboutDefinition, LunaticSource } from '../type.source'; import type { LunaticData, PageTag } from '../use-lunatic/type'; import { type ReactNode } from 'react'; export declare enum ArticulationState { COMPLETED = 1, STARTED = 0, NOT_STARTED = -1 } type ArticulationItem = { label: string; value: string; }; type Articulation = { source: string; items: ArticulationItem[]; }; type Item = { cells: { label: string; value: ReactNode; }[]; progress: ArticulationState; page: PageTag; }; /** * Retrieve the articulation state * * The goal of this function is to provide insights about a roundabout using extra information inserted in the JSON source * provided to Lunatic. * * For instance * * ``` * "articulation": { * "source": "roundabout", * "items": [ * { * "label": "Prénom", * "value": "PRENOMS" * }, * { * "label": "Sexe", * "value": "if SEXE = \"H\" then \"Homme\" else \"Femme\"" * }, * { * "label": "Age", * "value": "cast(AGE, string) || \" ans\"" * } * ] * }, * ``` * * - source is the ID of the roundabout component * - items define the field to extract from the roundabout data */ export declare function getArticulationState(source: LunaticSource & { articulation: Articulation; }, data: LunaticData): { items: Item[]; }; export declare function findComponentById(components: ComponentDefinition[], id: string): (ComponentRoundaboutDefinition & { page?: string; }) | null; export {};