/** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. */ export type ComponentDefinitionWithPage = ComponentDefinition & ({ page: string; } | { goToPage: string; }); export type ComponentDefinition = ComponentInputDefinition | ComponentSequenceDefinition | ComponentRoundaboutDefinition | ComponentLoopDefinition | ComponentRosterForLoopDefinition | ComponentTableDefinition | ComponentNumberDefinition | ComponentDurationDefinition | ComponentDatePickerDefinition | ComponentCheckboxGroupDefinition | ComponentCheckboxBooleanDefinition | ComponentRadioDefinition | ComponentDropdownDefinition | ComponentQuestionDefinition | ComponentCheckboxOneDefinition | ComponentSuggesterDefinition | ComponentPairWiseLinksDefinition | ComponentSummaryDefinition | ComponentText | ComponentAccordion | ComponentFilterDescriptionDefinition; export type ComponentInputDefinition = ComponentDefinitionBaseWithResponse & { componentType: 'Input' | 'Textarea'; maxLength?: number; }; export type ComponentDefinitionBaseWithResponse = ComponentDefinitionBase & { response: ResponseDefinition; }; export type ComponentSequenceDefinition = ComponentDefinitionBase & { componentType: 'Sequence' | 'Subsequence'; goToPage?: string; }; export type ComponentRoundaboutDefinition = ComponentDefinitionBase & { componentType: 'Roundabout'; loopDependencies?: string[]; iterations: VTLScalarExpression; locked: boolean; progressVariable: string; item: { label: VTLScalarExpression; description?: VTLScalarExpression; disabled?: VTLScalarExpression; }; components: ComponentDefinitionWithPage[]; }; export type ComponentLoopDefinition = { componentType: 'Loop'; loopDependencies?: string[]; } & ComponentLoopDefinition1; export type ComponentLoopDefinition1 = PaginatedLoop | BlockLoop; export type PaginatedLoop = ComponentDefinitionBase & { components: ComponentDefinitionWithPage[]; iterations: VTLScalarExpression; maxPage: string; paginatedLoop: true; }; export type BlockLoop = ComponentDefinitionBase & { paginatedLoop: false; components: ComponentDefinition[]; } & BlockLoop1; export type BlockLoop1 = { lines: { min: VTLExpression; max: VTLExpression; }; } | { iterations: VTLExpression; }; export type ComponentRosterForLoopDefinition = ComponentDefinitionBase & { componentType: 'RosterForLoop'; components: ComponentDefinition[]; lines: { min: VTLScalarExpression; max: VTLScalarExpression; }; header?: TableHeader; }; export type Options = { value: string | boolean; label: VTLExpression; description?: VTLExpression; conditionFilter?: VTLExpression; }[]; export type TableHeader = { value?: string; label: VTLExpression; colspan?: number; rowspan?: number; options?: Options; }[]; export type ComponentTableDefinition = ComponentDefinitionBase & { componentType: 'Table'; header?: TableHeader; body: (ComponentDefinition | { label: VTLExpression; })[][]; }; export type ComponentNumberDefinition = ComponentDefinitionBaseWithResponse & { componentType: 'InputNumber'; unit?: string | VTLExpression; min?: number; max?: number; decimals?: number; }; export type ComponentDurationDefinition = ComponentDefinitionBaseWithResponse & { componentType: 'Duration'; format: 'PnYnM' | 'PTnHnM'; }; export type ComponentDatePickerDefinition = ComponentDefinitionBaseWithResponse & { componentType: 'Datepicker'; dateFormat: 'YYYY-MM-DD' | 'YYYY' | 'YYYY-MM'; min?: string; max?: string; }; export type ComponentCheckboxGroupDefinition = ComponentDefinitionBase & { componentType: 'CheckboxGroup'; orientation?: 'horizontal' | 'vertical'; responses: { label: VTLExpression; description?: VTLExpression; response: ResponseDefinition; conditionFilter?: VTLExpression; id: string; detail?: { label?: VTLExpression; maxLength?: number; response: ResponseDefinition; }; }[]; }; export type ComponentCheckboxBooleanDefinition = ComponentDefinitionBaseWithResponse & { componentType: 'CheckboxBoolean'; }; export type ComponentRadioDefinition = ComponentDefinitionBaseWithResponse & { componentType: 'Radio'; orientation?: 'horizontal' | 'vertical'; } & ComponentRadioDefinition1; export type ComponentRadioDefinition1 = StaticOptions | OptionsFromVariable; export type OptionsWithDetail = { value: string | boolean; label: VTLExpression; description?: VTLExpression; detail?: { label: VTLExpression; maxLength?: number; response: { name: string; }; }; }[]; export type ComponentDropdownDefinition = ComponentDefinitionBaseWithResponse & { componentType: 'Dropdown'; } & ComponentDropdownDefinition1; export type ComponentDropdownDefinition1 = StaticOptions | OptionsFromVariable; export type ComponentQuestionDefinition = ComponentDefinitionBase & { componentType: 'Question'; components: ComponentDefinition[]; }; export type ComponentCheckboxOneDefinition = ComponentDefinitionBaseWithResponse & { componentType: 'CheckboxOne'; } & ComponentCheckboxOneDefinition1; export type ComponentCheckboxOneDefinition1 = StaticOptions | OptionsFromVariable; export type ComponentSuggesterDefinition = ComponentDefinitionBaseWithResponse & { componentType: 'Suggester'; /** * Nom / Index du référentiel à utiliser */ storeName: string; /** * Permet l'entrée d'une valeur arbitraire (Autre) */ arbitrary?: { response: ResponseDefinition; }; /** * Liste des attributs de la nomenclature à sauvegarder dans une variable */ optionResponses?: { /** * Nom de la variable */ name: string; /** * Nom de la propriété dans la nomenclature */ attribute: string; }[]; }; export type ComponentPairWiseLinksDefinition = ComponentDefinitionBase & { componentType: 'PairwiseLinks'; xAxisIterations?: VTLScalarExpression; yAxisIterations?: VTLScalarExpression; symLinks: { [k: string]: { [k: string]: string | null; }; }; sourceVariables?: { /** * Name of the variable containing the name of the respondent */ name?: string; /** * Name of the variable containing the sex/gender of the respondent (value of variable -> 1: man, 2: woman) */ gender?: string; }; components: ComponentDefinition[]; }; export type ComponentSummaryDefinition = ComponentDefinitionBase & { componentType: 'Summary'; sections: { id: string; iterations?: VTLExpression; title: VTLExpression; responses: { id: string; label: VTLExpression; value: VTLExpression; }[]; }[]; }; export type Variable = { variableType: 'EXTERNAL'; name: string; value: VariableValue; iterationReference?: string; dimension?: number; isDeletedOnReset?: boolean; } | { variableType: 'COLLECTED'; name: string; values?: { COLLECTED: VariableValue; }; iterationReference?: string; dimension?: number; } | { variableType: 'CALCULATED'; name: string; expression: VTLExpression; isIgnoredByLunatic?: boolean; bindingDependencies?: string[]; shapeFrom?: string[] | string; iterationReference?: string; dimension?: number; }; export type VariableValue = VariableScalarValue | unknown[]; export type VariableScalarValue = string | number | null | boolean; /** * Representation of a Lunatic questionnaire. */ export type LunaticSource = { label?: VTLExpression; pagination?: 'question' | 'sequence'; enoCoreVersion?: string; lunaticModelVersion?: string; generatingDate?: string; modele?: string; id?: string; components: ComponentDefinitionWithPage[]; variables: Variable[]; suggesters?: SuggesterDefinition[]; cleaning?: { [k: string]: { [k: string]: string | { expression: string; shapeFrom?: string; /** * @deprecated * use shouldCheckDuringResizing since lunaticModelVersion 5.16.0 */ isAggregatorUsed?: boolean; shouldCheckDuringResizing?: boolean; shouldCheckAllIterations?: boolean; }[]; }; }; missingBlock?: { [k: string]: string[]; }; resizing?: { [k: string]: { /** * VTL Expression for size. */ size: string; variables: string[]; } | { sizeForLinksVariables: [string, string] | { xAxisSize: string; yAxisSize: string; }; linksVariables: string[]; } | { /** * VTL Expression for size. */ size: string; variables: string[]; sizeForLinksVariables: [string, string] | { xAxisSize: string; yAxisSize: string; }; linksVariables: string[]; }; }; maxPage?: string; articulation?: { /** * id du composant roundabout */ source: string; /** * Ligne du tableau d'articulation */ items: { /** * Libellé du champs */ label: string; /** * Expression VTL */ value: string; }[]; }; multimode?: { questionnaire: { rules: { [k: string]: VTLExpression; }; }; leaf: { source: string; rules: { [k: string]: VTLExpression; }; }; }; }; export type VTLExpression = { /** * Valid VTL Expression */ value: string; /** * Variables used in the expression */ bindingDependencies?: string[]; variablesDependencies?: VariablesDependencies; type: 'VTL' | 'VTL|MD' | 'TXT'; }; /** * Variables grouped by type (collected, external and calculated) */ export type VariablesDependencies = { COLLECTED?: string[]; EXTERNAL?: string[]; CALCULATED?: string[]; }; export type ComponentDefinitionBase = { label?: VTLExpression; description?: VTLExpression; declarations?: Declaration[]; conditionFilter?: VTLScalarExpression; controls?: ControlDefinition[]; id: string; isMandatory?: boolean; missingResponse?: ResponseDefinition; conditionReadOnly?: VTLScalarExpression; }; export type Declaration = { id: string; declarationType: 'INSTRUCTION' | 'COMMENT' | 'HELP' | 'CODECARD' | 'WARNING' | 'STATEMENT'; position: 'AFTER_QUESTION_TEXT' | 'AFTER_RESPONSE' | 'BEFORE_QUESTION_TEXT' | 'DETACHABLE'; label: VTLExpression; }; export type VTLScalarExpression = { /** * Valid VTL Expression */ value: string; /** * Variables used in the expression */ bindingDependencies?: string[]; variablesDependencies?: VariablesDependencies; type: 'VTL'; shapeFrom?: string; }; export type ControlDefinition = { id: string; criticality: 'INFO' | 'WARN' | 'ERROR'; typeOfControl?: 'FORMAT' | 'CONSISTENCY' | 'MANDATORY'; control: VTLExpression; errorMessage: VTLExpression; bindingDependencies?: string[]; type?: 'roundabout' | 'ROW' | 'simple'; iterations?: VTLScalarExpression; }; export type ResponseDefinition = { name: string; }; export type StaticOptions = { options: OptionsWithDetail; }; export type OptionsFromVariable = { optionSource: string; optionFilter?: VTLExpression; }; export type ComponentText = { componentType: 'Text'; label: VTLExpression; }; export type ComponentAccordion = { componentType: 'Accordion'; items: { label: VTLExpression; body: VTLExpression; }[]; }; export type ComponentFilterDescriptionDefinition = { componentType: 'FilterDescription'; label: VTLExpression; }; export type SuggesterDefinition = { /** * Name of the list (will be used as storeName for suggester) */ name: string; /** * Fields to use for indexing the data */ fields: { /** * Property name in the JSON */ name: string; /** * Minimum length for a token to be indexed */ min?: number; /** * Regular expression to match words (ex: ["[\\w]+"]) */ rules?: 'soft' | string[]; synonyms?: { [k: string]: string[]; }; }[]; /** * Limit the number of results to return */ max?: number; queryParser: { /** * Search type: word by word search using OR operator. */ type: 'tokenized'; /** * Parameters for tokenized search. */ params: { /** * Language used for stemming (keeping the root of a word). */ language: 'French' | 'English'; /** * Regular expression pattern to match words. */ pattern: string; /** * Minimum length for a token to be used in the search. */ min?: number; }; } | { type: 'soft'; }; /** * list of words to exclude from the searching */ stopWords?: string[]; };