-
Notifications
You must be signed in to change notification settings - Fork 70
/
index.d.ts
122 lines (101 loc) · 3.07 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
import { Evaluation, Rule, RuleNode, Situation } from 'publicodes'
import { Categories as GeneratedCategories } from './types/categories.d'
import { DottedName as GeneratedDottedName } from './types/dottedNames'
import { Subcategories as GeneratedSubcategories } from './types/subcategories.d'
export type DottedName = GeneratedDottedName
export type Categories = GeneratedCategories
export type Subcategories = GeneratedSubcategories
export type NGCRuleNode = RuleNode & {
rawNode: NGCRule
}
export type NGCRulesNodes = Record<DottedName, NGCRuleNode>
export type NodeValue = Evaluation
export type SuggestionValue = 'oui' | 'non' | number
export type Suggestions = Record<
string,
SuggestionValue | Record<string, SuggestionValue>
>
export type MosaiqueNode = {
type: 'selection' | 'nombre'
options: DottedName[]
suggestions?: Suggestions
}
export type MosaicInfos = {
mosaicRule: RuleNode
mosaicParams: MosaiqueNode
mosaicDottedNames: [DottedName, NGCRuleNode][]
}
export type MigrationType = {
keysToMigrate: Record<DottedName, DottedName>
valuesToMigrate: Record<DottedName, Record<string, NodeValue>>
}
export type Persona = {
nom: string
description: string
icônes: string
résumé?: string
situation: Situation<DottedName>
}
export type Personas = Record<string, Persona>
export type migrationType = {
keysToMigrate: Record<DottedName, DottedName>
valuesToMigrate: Record<DottedName, Record<string, NodeValue>>
}
export type RegionAuthor = {
nom: string
url?: string
}
export type RegionCode = string
export type RegionParams = {
code: RegionCode
nom: string
gentilé: string
authors?: RegionAuthor[]
drapeau?: string
}
export type SupportedRegion = Record<string, RegionParams>
export type SupportedRegions = Record<RegionCode, SupportedRegion>
export type NGCRule = Omit<
Rule,
'formule' | 'question' | 'valeur' | 'description' | 'note'
> & {
formule?: Rule['formule'] | number
question?: Rule['question'] | null
valeur?: Rule['valeur'] | number
description?: Rule['description'] | string
note?: Rule['note'] | string
abréviation?: string
mosaique?: MosaiqueNode
type?: string
action?: { dépasse: string[] }
icônes?: string
aide?: string
inactif?: string
plancher?: string | number
plafond?: string | number
avertissement?: string
}
export type Metrics = 'carbone' | 'eau'
export type NGCRules = Record<DottedName, NGCRule>
export type FunFacts = {
percentageOfBicycleUsers: number
percentageOfVegetarians: number
percentageOfCarOwners: number
percentageOfPlaneUsers: number
percentageOfLongPlaneUsers: number
averageOfCarKilometers: number
averageOfTravelers: number
percentageOfElectricHeating: number
percentageOfGasHeating: number
percentageOfFuelHeating: number
percentageOfWoodHeating: number
averageOfElectricityConsumption: number
percentageOfCoolingSystem: number
percentageOfVegan: number
percentageOfRedMeat: number
percentageOfLocalAndSeasonal: number
percentageOfBottledWater: number
percentageOfZeroWaste: number
amountOfClothing: number
percentageOfStreaming: number
}