|
1 | 1 | export type Section = {
|
2 |
| - id: string; // Identifiant unique de la section |
3 |
| - title: string; // Titre de la section |
4 |
| - content?: Content[]; // Tableau des contenus de la section, |
5 |
| - subSections?: Omit<Section, 'subSection'>[]; // Tableau des sous-sections |
| 2 | + id: string; |
| 3 | + title: string; |
| 4 | + content?: Content[]; |
| 5 | + subSections?: Omit<Section, 'subSection'>[]; |
6 | 6 | };
|
7 | 7 |
|
8 |
| -// Définition des différents types de contenu qu'une section peut avoir |
9 | 8 | export type Content = ListContent | TextContent | FAQContent | GlossaryContent;
|
10 | 9 |
|
11 |
| -// Contenu sous forme de liste |
12 | 10 | export type ListContent = {
|
13 |
| - type: 'list'; // Indique qu'il s'agit d'une liste |
14 |
| - items: Record<string, string>[]; // Tableau des éléments de la liste |
| 11 | + type: 'list'; |
| 12 | + items: Record<string, string>[]; |
15 | 13 | };
|
16 | 14 |
|
17 |
| -// Contenu sous forme de texte |
18 | 15 | export type TextContent = {
|
19 |
| - type: 'text'; // Indique qu'il s'agit d'un texte |
20 |
| - value: string; // Texte contenant éventuellement du HTML |
| 16 | + type: 'text'; |
| 17 | + value: string; |
21 | 18 | };
|
22 | 19 |
|
23 | 20 | export type FAQItem = {
|
24 |
| - question: string; // La question |
25 |
| - answer: string; // La réponse |
| 21 | + question: string; |
| 22 | + answer: string; |
26 | 23 | };
|
27 | 24 |
|
28 | 25 | export type FAQContent = {
|
29 |
| - type: 'faq'; // Indique qu'il s'agit d'une FAQ |
30 |
| - questions: FAQItem[]; // La question |
| 26 | + type: 'faq'; |
| 27 | + questions: FAQItem[]; |
31 | 28 | };
|
32 | 29 |
|
33 |
| -// Contenu sous forme de glossaire (clé/valeur) |
34 | 30 | export type GlossaryContent = {
|
35 |
| - type: 'definitions'; // Indique qu'il s'agit d'un glossaire |
36 |
| - definitions: GlossaryItem[]; // Dictionnaire terme -> définition |
| 31 | + type: 'definitions'; |
| 32 | + definitions: GlossaryItem[]; |
37 | 33 | };
|
38 | 34 |
|
39 | 35 | export type GlossaryItem = {
|
40 |
| - term: string; // Terme du glossaire |
41 |
| - definition: string; // Définition du terme |
| 36 | + term: string; |
| 37 | + definition: string; |
42 | 38 | };
|
0 commit comments