@auditcore/ui-core 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1326 -0
  3. package/dist/account/camera.d.ts +8 -0
  4. package/dist/account/controller.d.ts +30 -0
  5. package/dist/account/index.d.ts +7 -0
  6. package/dist/account/messages.d.ts +2 -0
  7. package/dist/account/port.d.ts +10 -0
  8. package/dist/account/presentation.d.ts +9 -0
  9. package/dist/account/types.d.ts +42 -0
  10. package/dist/account/view.d.ts +12 -0
  11. package/dist/attributes/controller.d.ts +26 -0
  12. package/dist/attributes/index.d.ts +5 -0
  13. package/dist/attributes/messages.d.ts +3 -0
  14. package/dist/attributes/port.d.ts +4 -0
  15. package/dist/attributes/types.d.ts +60 -0
  16. package/dist/attributes/view.d.ts +49 -0
  17. package/dist/base/icons.d.ts +38 -0
  18. package/dist/base/index.d.ts +3 -0
  19. package/dist/base/types.d.ts +3 -0
  20. package/dist/batchchecks/controller.d.ts +60 -0
  21. package/dist/batchchecks/index.d.ts +7 -0
  22. package/dist/batchchecks/messages.d.ts +3 -0
  23. package/dist/batchchecks/model.d.ts +38 -0
  24. package/dist/batchchecks/port.d.ts +6 -0
  25. package/dist/batchchecks/rest-port.d.ts +4 -0
  26. package/dist/batchchecks/types.d.ts +121 -0
  27. package/dist/batchchecks/view.d.ts +58 -0
  28. package/dist/benford/chart.d.ts +49 -0
  29. package/dist/benford/controller.d.ts +48 -0
  30. package/dist/benford/index.d.ts +7 -0
  31. package/dist/benford/messages.d.ts +3 -0
  32. package/dist/benford/model.d.ts +32 -0
  33. package/dist/benford/rest-port.d.ts +4 -0
  34. package/dist/benford/types.d.ts +144 -0
  35. package/dist/benford/view.d.ts +45 -0
  36. package/dist/dataprotection/dsfa.d.ts +55 -0
  37. package/dist/dataprotection/dsfaView.d.ts +45 -0
  38. package/dist/dataprotection/exporters.d.ts +33 -0
  39. package/dist/dataprotection/index.d.ts +10 -0
  40. package/dist/dataprotection/messages.d.ts +5 -0
  41. package/dist/dataprotection/registerView.d.ts +47 -0
  42. package/dist/dataprotection/requests.d.ts +16 -0
  43. package/dist/dataprotection/rest-port.d.ts +4 -0
  44. package/dist/dataprotection/types.d.ts +291 -0
  45. package/dist/dataprotection/vvt.d.ts +69 -0
  46. package/dist/dbkanban/controller.d.ts +54 -0
  47. package/dist/dbkanban/index.d.ts +3 -0
  48. package/dist/dbkanban/messages.d.ts +5 -0
  49. package/dist/dbkanban/view.d.ts +39 -0
  50. package/dist/documents/controller.d.ts +63 -0
  51. package/dist/documents/form.d.ts +52 -0
  52. package/dist/documents/importing.d.ts +12 -0
  53. package/dist/documents/index.d.ts +6 -0
  54. package/dist/documents/list.d.ts +21 -0
  55. package/dist/documents/messages.d.ts +8 -0
  56. package/dist/documents/view.d.ts +36 -0
  57. package/dist/download.d.ts +14 -0
  58. package/dist/extraction/controller.d.ts +34 -0
  59. package/dist/extraction/index.d.ts +5 -0
  60. package/dist/extraction/messages.d.ts +3 -0
  61. package/dist/extraction/rest-port.d.ts +4 -0
  62. package/dist/extraction/types.d.ts +115 -0
  63. package/dist/extraction/view.d.ts +35 -0
  64. package/dist/extrapolation/controller-subsample.d.ts +20 -0
  65. package/dist/extrapolation/controller.d.ts +72 -0
  66. package/dist/extrapolation/index.d.ts +9 -0
  67. package/dist/extrapolation/messages.d.ts +3 -0
  68. package/dist/extrapolation/model-design.d.ts +28 -0
  69. package/dist/extrapolation/model-subsample.d.ts +40 -0
  70. package/dist/extrapolation/model.d.ts +92 -0
  71. package/dist/extrapolation/rest-port.d.ts +4 -0
  72. package/dist/extrapolation/types.d.ts +255 -0
  73. package/dist/extrapolation/view-details.d.ts +46 -0
  74. package/dist/extrapolation/view.d.ts +50 -0
  75. package/dist/focus.d.ts +10 -0
  76. package/dist/geo/controller.d.ts +87 -0
  77. package/dist/geo/index.d.ts +6 -0
  78. package/dist/geo/mapView.d.ts +30 -0
  79. package/dist/geo/messages.d.ts +3 -0
  80. package/dist/geo/model.d.ts +43 -0
  81. package/dist/geo/rest-port.d.ts +12 -0
  82. package/dist/geo/types.d.ts +195 -0
  83. package/dist/i18n.d.ts +29 -0
  84. package/dist/identifiers/controller.d.ts +63 -0
  85. package/dist/identifiers/index.d.ts +5 -0
  86. package/dist/identifiers/messages.d.ts +3 -0
  87. package/dist/identifiers/model.d.ts +87 -0
  88. package/dist/identifiers/rest-port.d.ts +4 -0
  89. package/dist/identifiers/types.d.ts +101 -0
  90. package/dist/index.d.ts +33 -0
  91. package/dist/index.js +10676 -0
  92. package/dist/index.js.map +1 -0
  93. package/dist/kanban/index.d.ts +2 -0
  94. package/dist/kanban/messages.d.ts +6 -0
  95. package/dist/messages.d.ts +2 -0
  96. package/dist/reporting/controller.d.ts +46 -0
  97. package/dist/reporting/index.d.ts +5 -0
  98. package/dist/reporting/messages.d.ts +3 -0
  99. package/dist/reporting/rest-port.d.ts +4 -0
  100. package/dist/reporting/types.d.ts +72 -0
  101. package/dist/reporting/view.d.ts +12 -0
  102. package/dist/reporttemplates/controller.d.ts +46 -0
  103. package/dist/reporttemplates/index.d.ts +5 -0
  104. package/dist/reporttemplates/messages.d.ts +3 -0
  105. package/dist/reporttemplates/port.d.ts +4 -0
  106. package/dist/reporttemplates/types.d.ts +92 -0
  107. package/dist/reporttemplates/view.d.ts +27 -0
  108. package/dist/risk/controller.d.ts +54 -0
  109. package/dist/risk/format.d.ts +13 -0
  110. package/dist/risk/index.d.ts +7 -0
  111. package/dist/risk/labels.d.ts +9 -0
  112. package/dist/risk/messages.d.ts +3 -0
  113. package/dist/risk/port.d.ts +41 -0
  114. package/dist/risk/state.d.ts +61 -0
  115. package/dist/risk/types.d.ts +107 -0
  116. package/dist/runner/aktionen.d.ts +16 -0
  117. package/dist/runner/controller.d.ts +72 -0
  118. package/dist/runner/eingabe.d.ts +5 -0
  119. package/dist/runner/index.d.ts +9 -0
  120. package/dist/runner/messages.d.ts +3 -0
  121. package/dist/runner/port.d.ts +20 -0
  122. package/dist/runner/profil.d.ts +39 -0
  123. package/dist/runner/types.d.ts +109 -0
  124. package/dist/runner/view-listen.d.ts +32 -0
  125. package/dist/runner/view.d.ts +95 -0
  126. package/dist/samplesize/controller.d.ts +33 -0
  127. package/dist/samplesize/index.d.ts +7 -0
  128. package/dist/samplesize/messages.d.ts +3 -0
  129. package/dist/samplesize/model.d.ts +40 -0
  130. package/dist/samplesize/port.d.ts +9 -0
  131. package/dist/samplesize/types.d.ts +92 -0
  132. package/dist/samplesize/view.d.ts +39 -0
  133. package/dist/sampling/controller.d.ts +62 -0
  134. package/dist/sampling/index.d.ts +6 -0
  135. package/dist/sampling/messages.d.ts +3 -0
  136. package/dist/sampling/model.d.ts +63 -0
  137. package/dist/sampling/rest-port.d.ts +4 -0
  138. package/dist/sampling/types.d.ts +136 -0
  139. package/dist/sampling/view.d.ts +45 -0
  140. package/dist/screening/controller.d.ts +52 -0
  141. package/dist/screening/index.d.ts +8 -0
  142. package/dist/screening/messages.d.ts +7 -0
  143. package/dist/screening/rest-port.d.ts +4 -0
  144. package/dist/screening/runForm.d.ts +22 -0
  145. package/dist/screening/types.d.ts +295 -0
  146. package/dist/screening/view.d.ts +84 -0
  147. package/dist/store.d.ts +30 -0
  148. package/dist/synopsis/controller.d.ts +68 -0
  149. package/dist/synopsis/exporters.d.ts +16 -0
  150. package/dist/synopsis/index.d.ts +8 -0
  151. package/dist/synopsis/messages.d.ts +3 -0
  152. package/dist/synopsis/navigation.d.ts +5 -0
  153. package/dist/synopsis/port.d.ts +38 -0
  154. package/dist/synopsis/types.d.ts +121 -0
  155. package/dist/synopsis/viewModel.d.ts +74 -0
  156. package/dist/synopsis/wordDiff.d.ts +31 -0
  157. package/dist/table/index.d.ts +6 -0
  158. package/dist/tabular/index.d.ts +2 -0
  159. package/dist/tabular/messages.d.ts +3 -0
  160. package/dist/tabular/tableImport.d.ts +40 -0
  161. package/package.json +55 -0
  162. package/styles/account.css +37 -0
  163. package/styles/attributes.css +18 -0
  164. package/styles/base.css +116 -0
  165. package/styles/batchchecks.css +26 -0
  166. package/styles/benford.css +39 -0
  167. package/styles/dataprotection.css +68 -0
  168. package/styles/dbkanban.css +38 -0
  169. package/styles/documents.css +51 -0
  170. package/styles/extraction.css +25 -0
  171. package/styles/extrapolation.css +34 -0
  172. package/styles/geo.css +54 -0
  173. package/styles/identifiers.css +38 -0
  174. package/styles/index.css +24 -0
  175. package/styles/kanban.css +115 -0
  176. package/styles/reporting.css +22 -0
  177. package/styles/reporttemplates.css +21 -0
  178. package/styles/risk.css +92 -0
  179. package/styles/runner.css +54 -0
  180. package/styles/samplesize.css +27 -0
  181. package/styles/sampling.css +31 -0
  182. package/styles/screening.css +86 -0
  183. package/styles/synopsis.css +83 -0
  184. package/styles/table.css +17 -0
  185. package/styles/tabular.css +11 -0
  186. package/styles/tokens.css +121 -0
@@ -0,0 +1,255 @@
1
+ import { DownloadFile } from '@auditcore/common';
2
+ export interface ExtrapolationMethod {
3
+ id: string;
4
+ label: string;
5
+ statistical: boolean;
6
+ selection: 'equal_probability' | 'pps';
7
+ stratification: boolean;
8
+ source: string;
9
+ formula: string;
10
+ needs_population_size: boolean;
11
+ needs_sample_size: boolean;
12
+ /** Mehrperiodenform vorhanden (Leitfaden 7.3); fehlt bei älteren Backends. */
13
+ periods?: boolean;
14
+ }
15
+ export type ExtrapolationDesign = 'single' | 'periods' | 'groups';
16
+ export interface SystemAssessmentLevel {
17
+ category: number;
18
+ label: string;
19
+ confidence_level: number;
20
+ }
21
+ export interface FactorProfileInfo {
22
+ id: string;
23
+ label: string;
24
+ source: string;
25
+ note: string;
26
+ }
27
+ export interface ExtrapolationCatalogue {
28
+ contract: string;
29
+ library: string;
30
+ sources: Readonly<Record<string, string>>;
31
+ methods: readonly ExtrapolationMethod[];
32
+ factor_profiles: readonly FactorProfileInfo[];
33
+ recommended_profile: string;
34
+ confidence_levels: {
35
+ z: readonly number[];
36
+ 'mus.conservative': readonly number[];
37
+ };
38
+ materiality: {
39
+ default: number;
40
+ maximum: number;
41
+ };
42
+ error_classes: readonly {
43
+ id: string;
44
+ label: string;
45
+ description: string;
46
+ }[];
47
+ conclusions: readonly {
48
+ id: Conclusion;
49
+ label: string;
50
+ }[];
51
+ limits: {
52
+ max_units: number;
53
+ max_strata: number;
54
+ max_periods?: number;
55
+ };
56
+ designs?: readonly {
57
+ id: ExtrapolationDesign;
58
+ label: string;
59
+ source: string;
60
+ }[];
61
+ subsample_estimators?: readonly {
62
+ id: SubsampleEstimator;
63
+ label: string;
64
+ }[];
65
+ system_assessment?: readonly SystemAssessmentLevel[];
66
+ }
67
+ export type SubsampleEstimator = 'ratio' | 'mean_per_unit' | 'pps';
68
+ /** Teilstichprobe einer Einheit (Leitfaden 7.6, 6.5.3). */
69
+ export interface SubsampleInput {
70
+ estimator: SubsampleEstimator;
71
+ strata: readonly StratumInput[];
72
+ units: readonly UnitInput[];
73
+ }
74
+ export interface StratumInput {
75
+ name: string;
76
+ book_value: number;
77
+ population_size?: number;
78
+ systemic_error?: number;
79
+ /** Zeitraum (mit `periods`) */
80
+ period?: string;
81
+ /** Programm einer Gruppe von Programmen (Leitfaden 7.8) */
82
+ group?: string;
83
+ }
84
+ export interface UnitInput {
85
+ id: string;
86
+ stratum: string;
87
+ book_value: number;
88
+ random_error?: number;
89
+ systemic_error?: number;
90
+ anomalous_error?: number;
91
+ anomalous_reason?: string;
92
+ anomalous_corrected?: boolean;
93
+ exhaustive?: boolean;
94
+ period?: string;
95
+ subsample?: SubsampleInput;
96
+ }
97
+ export interface EvaluationRequest {
98
+ method: string;
99
+ confidence_level?: number;
100
+ factor_profile?: string;
101
+ sample_size?: number;
102
+ materiality_rate: number;
103
+ strata: readonly StratumInput[];
104
+ units: readonly UnitInput[];
105
+ periods?: readonly {
106
+ name: string;
107
+ }[];
108
+ population_units?: number;
109
+ system_assessment?: number;
110
+ }
111
+ export interface ExtrapolationStep {
112
+ label: string;
113
+ formula: string;
114
+ value: number;
115
+ source: string;
116
+ }
117
+ export interface StratumProjection {
118
+ name: string;
119
+ projected_error: number;
120
+ exhaustive_error: number;
121
+ sample_size: number;
122
+ sampling_book_value: number;
123
+ figures: Readonly<Record<string, number>>;
124
+ period?: string;
125
+ }
126
+ export interface PeriodSummary {
127
+ name: string;
128
+ book_value: number;
129
+ projected_random_error: number;
130
+ precision: number | null;
131
+ sample_size: number;
132
+ }
133
+ export interface SubsampleResult {
134
+ unit_id: string;
135
+ estimator: SubsampleEstimator;
136
+ book_value: number;
137
+ projected_error: number;
138
+ error_rate: number;
139
+ audited_book_value: number;
140
+ coverage: number;
141
+ sampled_items: number;
142
+ exhaustive_items: number;
143
+ warnings: readonly string[];
144
+ }
145
+ export interface ConfidenceRecalculation {
146
+ applicable: boolean;
147
+ reason: string | null;
148
+ coefficient: number | null;
149
+ recalculated_coefficient: number | null;
150
+ confidence_level: number | null;
151
+ required_level: number | null;
152
+ supports_not_material: boolean | null;
153
+ steps: readonly ExtrapolationStep[];
154
+ }
155
+ export interface Projection {
156
+ method: string;
157
+ projected_random_error: number;
158
+ precision: number | null;
159
+ confidence_level: number | null;
160
+ factor_profile: string | null;
161
+ coefficient: number | null;
162
+ strata: readonly StratumProjection[];
163
+ sample_errors: {
164
+ random: number;
165
+ systemic: number;
166
+ anomalous_uncorrected: number;
167
+ anomalous_corrected: number;
168
+ };
169
+ systemic_population: number;
170
+ steps: readonly ExtrapolationStep[];
171
+ warnings: readonly string[];
172
+ extra: Readonly<Record<string, unknown>>;
173
+ }
174
+ export type Conclusion = 'material' | 'not_material' | 'inconclusive';
175
+ export interface TotalErrorRate {
176
+ book_value: number;
177
+ materiality_rate: number;
178
+ tolerable_error: number;
179
+ projected_random_error: number;
180
+ systemic_errors: number;
181
+ anomalous_uncorrected: number;
182
+ anomalous_corrected_excluded: number;
183
+ total_error: number;
184
+ rate: number;
185
+ precision: number | null;
186
+ upper_limit: number | null;
187
+ upper_limit_rate: number | null;
188
+ conclusion: Conclusion;
189
+ explanation: readonly string[];
190
+ steps: readonly ExtrapolationStep[];
191
+ difference: {
192
+ corrected_book_value: number;
193
+ lower_limit: number;
194
+ book_value_less_tolerable: number;
195
+ } | null;
196
+ }
197
+ export interface EvaluationResult {
198
+ contract: string;
199
+ library: string;
200
+ fingerprint: string;
201
+ method: ExtrapolationMethod;
202
+ projection: Projection;
203
+ total_error_rate: TotalErrorRate;
204
+ design?: ExtrapolationDesign;
205
+ confidence_recalculation?: ConfidenceRecalculation;
206
+ subsamples?: readonly SubsampleResult[];
207
+ groups?: readonly GroupResult[];
208
+ }
209
+ export interface GroupResult {
210
+ name: string;
211
+ observations: number;
212
+ warnings: readonly string[];
213
+ projection: Projection;
214
+ total_error_rate: TotalErrorRate;
215
+ }
216
+ export interface ResidualRequest {
217
+ audit_population: number;
218
+ total_error_rate: number;
219
+ ongoing_assessment: number;
220
+ other_negative_amounts: number;
221
+ financial_corrections: number;
222
+ materiality_rate: number;
223
+ }
224
+ export interface ResidualRow {
225
+ row: string;
226
+ label: string;
227
+ value: number | null;
228
+ exact: string | null;
229
+ }
230
+ export interface ResidualErrorRate {
231
+ source: string;
232
+ rate: number | null;
233
+ rate_rounded: number | null;
234
+ exceeds_materiality: boolean;
235
+ materiality_rate: number;
236
+ extrapolated_correction: number | null;
237
+ rate_after_correction: number | null;
238
+ rows: readonly ResidualRow[];
239
+ not_applicable: string | null;
240
+ notes: readonly string[];
241
+ }
242
+ export interface ResidualResult {
243
+ contract: string;
244
+ library: string;
245
+ fingerprint: string;
246
+ residual_error_rate: ResidualErrorRate;
247
+ }
248
+ export type ExtrapolationExportFormat = 'csv' | 'json';
249
+ /** Schnittstelle der Komponente zur Fachlogik; Standardumsetzung: `createExtrapolationRestPort`. */
250
+ export interface ExtrapolationPort {
251
+ profiles(): Promise<ExtrapolationCatalogue>;
252
+ evaluate(request: EvaluationRequest): Promise<EvaluationResult>;
253
+ residual(request: ResidualRequest): Promise<ResidualResult>;
254
+ exportEvaluation(request: EvaluationRequest, format: ExtrapolationExportFormat): Promise<DownloadFile>;
255
+ }
@@ -0,0 +1,46 @@
1
+ import { TableColumn, TableRow } from '@auditcore/common';
2
+ import { Locale } from '../i18n';
3
+ import { openSubsample } from './controller-subsample';
4
+ import { ExtrapolationData } from './controller';
5
+ import { SubItemRow, SubStratumRow } from './model-subsample';
6
+ import { ExtrapolationField, ExtrapolationMetric, ExtrapolationTranslate } from './view';
7
+ import { EvaluationResult, ExtrapolationCatalogue, ExtrapolationDesign, SubsampleEstimator } from './types';
8
+ export interface ExtrapolationChoice<T extends string> {
9
+ id: T;
10
+ label: string;
11
+ }
12
+ export declare function extrapolationDesignChoices(catalogue: ExtrapolationCatalogue | null, t: ExtrapolationTranslate): ExtrapolationChoice<ExtrapolationDesign>[];
13
+ export declare function subsampleEstimatorChoices(t: ExtrapolationTranslate): ExtrapolationChoice<SubsampleEstimator>[];
14
+ /** Kategorien 1–4 der Systembewertung mit Konfidenzniveau (Tabelle 1, Leitfaden 3.2.1). */
15
+ export declare function systemAssessmentChoices(catalogue: ExtrapolationCatalogue | null, locale: Locale): ExtrapolationChoice<string>[];
16
+ export declare const SUB_ITEM_FIELDS: readonly ExtrapolationField<'id' | 'bookValue' | 'random'>[];
17
+ export declare const SUB_STRATUM_FIELDS: readonly ExtrapolationField<'name' | 'bookValue' | 'populationSize'>[];
18
+ export type SubStratumFieldKey = keyof Pick<SubStratumRow, 'name' | 'bookValue' | 'populationSize'>;
19
+ /** Ansicht der gerade bearbeiteten Teilstichprobe: Zeilen, Überschrift, Feldpräfix, Stufe. */
20
+ export interface SubsampleEditorView {
21
+ rows: NonNullable<ReturnType<typeof openSubsample>>;
22
+ title: string;
23
+ /** Präfix der Feldbefunde, z. B. `units.2.subsample`. */
24
+ prefix: string;
25
+ nested: boolean;
26
+ /** Teileinheiten dürfen eine eigene Teilstichprobe haben (nur Stufe 2). */
27
+ allowNested: boolean;
28
+ }
29
+ export declare function subsampleEditorView(state: ExtrapolationData, t: ExtrapolationTranslate): SubsampleEditorView | null;
30
+ export type SubItemFieldKey = keyof Pick<SubItemRow, 'id' | 'bookValue' | 'random'>;
31
+ export declare function periodColumns(t: ExtrapolationTranslate, locale: Locale): TableColumn[];
32
+ export declare function periodRows(result: EvaluationResult): TableRow[];
33
+ export declare function groupColumns(t: ExtrapolationTranslate, locale: Locale): TableColumn[];
34
+ export declare function groupRows(result: EvaluationResult, catalogue: ExtrapolationCatalogue | null): TableRow[];
35
+ export declare function subsampleColumns(t: ExtrapolationTranslate, locale: Locale): TableColumn[];
36
+ export declare function subsampleResultRows(result: EvaluationResult, t: ExtrapolationTranslate): TableRow[];
37
+ /** Hinweise aus Gruppen und Teilstichproben (die der Hochrechnung stehen im Ergebnis). */
38
+ export declare function detailWarnings(result: EvaluationResult): string[];
39
+ export interface RecalculationView {
40
+ metrics: ExtrapolationMetric[];
41
+ verdict: string;
42
+ }
43
+ /** Neuberechnung des Konfidenzniveaus; `null`, wenn nicht anwendbar (Ergebnis schlüssig usw.). */
44
+ export declare function recalculationView(result: EvaluationResult, t: ExtrapolationTranslate, locale: Locale): RecalculationView | null;
45
+ /** Gibt es Ergänzungen anzuzeigen? */
46
+ export declare function hasExtrapolationDetails(result: EvaluationResult): boolean;
@@ -0,0 +1,50 @@
1
+ import { TableColumn, TableRow } from '@auditcore/common';
2
+ import { BadgeTone } from '../base/types';
3
+ import { Locale, Translate } from '../i18n';
4
+ import { ExtrapolationMessageKey } from './messages';
5
+ import { ExtrapolationFormError, ExtrapolationIssue } from './model';
6
+ import { Conclusion, EvaluationResult, ExtrapolationCatalogue, ExtrapolationMethod, ResidualErrorRate } from './types';
7
+ export type ExtrapolationTranslate = Translate<ExtrapolationMessageKey>;
8
+ export declare function conclusionTone(conclusion: Conclusion): BadgeTone;
9
+ export declare function conclusionLabel(catalogue: ExtrapolationCatalogue | null, conclusion: Conclusion): string;
10
+ export declare function extrapolationAmount(value: number, locale: Locale): string;
11
+ export declare function extrapolationRate(value: number, locale: Locale): string;
12
+ /** Zahl als Eingabetext (ohne Tausendertrenner). */
13
+ export declare function extrapolationInputNumber(locale: Locale): (value: number) => string;
14
+ export declare function extrapolationIssueKey(issue: ExtrapolationIssue): ExtrapolationMessageKey;
15
+ export declare function extrapolationFormErrorKey(error: ExtrapolationFormError): ExtrapolationMessageKey;
16
+ export interface ExtrapolationMethodGroup {
17
+ statistical: boolean;
18
+ label: string;
19
+ methods: readonly ExtrapolationMethod[];
20
+ }
21
+ export declare function extrapolationMethodGroups(catalogue: ExtrapolationCatalogue, t: ExtrapolationTranslate): ExtrapolationMethodGroup[];
22
+ export declare function extrapolationConfidenceLabel(level: number, locale: Locale): string;
23
+ export interface ExtrapolationMetric {
24
+ id: string;
25
+ label: string;
26
+ value: string;
27
+ detail?: string;
28
+ }
29
+ /** Kennzahlen der Gesamtfehlerquote in fester Reihenfolge. */
30
+ export declare function terMetrics(result: EvaluationResult, t: ExtrapolationTranslate, locale: Locale): ExtrapolationMetric[];
31
+ export declare function extrapolationStepColumns(t: ExtrapolationTranslate, locale: Locale): TableColumn[];
32
+ export declare function extrapolationStepRows(result: EvaluationResult): TableRow[];
33
+ export declare function residualColumns(t: ExtrapolationTranslate, locale: Locale): TableColumn[];
34
+ export declare function residualRows(residual: ResidualErrorRate): TableRow[];
35
+ /** Kennzahlen der Restfehlerquote (K, L, M). */
36
+ export declare function residualMetrics(residual: ResidualErrorRate, t: ExtrapolationTranslate, locale: Locale): ExtrapolationMetric[];
37
+ export interface ExtrapolationField<K extends string> {
38
+ key: K;
39
+ label: ExtrapolationMessageKey;
40
+ numeric: boolean;
41
+ }
42
+ export declare const STRATUM_FIELDS: readonly ExtrapolationField<'name' | 'bookValue' | 'populationSize' | 'systemic'>[];
43
+ export declare const UNIT_FIELDS: readonly ExtrapolationField<'id' | 'bookValue' | 'random' | 'systemic' | 'anomalous' | 'reason'>[];
44
+ export declare const UNIT_FLAGS: readonly ExtrapolationField<'corrected' | 'exhaustive'>[];
45
+ export declare const RESIDUAL_FIELDS: readonly ExtrapolationField<'auditPopulation' | 'terRate' | 'ongoing' | 'otherNegative' | 'corrections'>[];
46
+ /** Meldung eines Feldes (leer ohne Befund). */
47
+ export declare function extrapolationIssueText(issues: Readonly<Record<string, ExtrapolationIssue>>, key: string, t: ExtrapolationTranslate): string;
48
+ /** Sammelmeldung unter dem Formular: fehlende Auswahl oder markierte Felder. */
49
+ export declare function extrapolationFormMessage(formError: ExtrapolationFormError | null, issues: Readonly<Record<string, ExtrapolationIssue>>, t: ExtrapolationTranslate): string;
50
+ export declare function extrapolationCellLabel(t: ExtrapolationTranslate, field: ExtrapolationMessageKey, row: number): string;
@@ -0,0 +1,10 @@
1
+ export declare function focusableWithin(container: HTMLElement): HTMLElement[];
2
+ /** Nächstes Fokusziel beim Tabben am Rand des Containers, sonst null (Browser übernimmt). */
3
+ export declare function wrapTarget(items: HTMLElement[], current: Element | null, backwards: boolean): HTMLElement | null;
4
+ export interface FocusTrap {
5
+ /** Fokus in den Container (Element mit `autofocus`, sonst erstes fokussierbares) und Tab-Taste einfangen. */
6
+ activate: () => void;
7
+ /** Falle lösen und den Fokus an das vorher fokussierte Element zurückgeben. */
8
+ deactivate: () => void;
9
+ }
10
+ export declare function createFocusTrap(container: () => HTMLElement | null): FocusTrap;
@@ -0,0 +1,87 @@
1
+ import { Store } from '../store';
2
+ import { CoordinateError, UtmInputError } from './model';
3
+ import { MapLayers } from './mapView';
4
+ import { GeoArea, GeoCatalogue, GeocodeResult, GeoPackageResult, GeoPoint, GeoPort, LatLon, LocateResult, RadiusResult, SimplifyResult, SimplifyUnit, UtmResult } from './types';
5
+ export type GeoBusy = 'load' | 'radius' | 'locate' | 'utm' | 'simplify' | 'gpkg' | 'geocode';
6
+ export type GeoHint = 'needReference' | 'needArea' | 'needModel' | null;
7
+ export interface GeoMapCallbacks {
8
+ radius?: (result: RadiusResult) => void;
9
+ located?: (result: LocateResult) => void;
10
+ areasLoaded?: (areas: readonly GeoArea[], result: GeoPackageResult) => void;
11
+ reference?: (point: LatLon | null) => void;
12
+ failed?: (message: string) => void;
13
+ }
14
+ export interface GeoData {
15
+ busy: GeoBusy | null;
16
+ failure: string;
17
+ error: string | null;
18
+ notice: string;
19
+ hint: GeoHint;
20
+ catalogue: GeoCatalogue | null;
21
+ earthModel: string | null;
22
+ radiusMetres: number;
23
+ radiusResult: RadiusResult | null;
24
+ boundaryInside: boolean;
25
+ toleranceMetres: number;
26
+ locateResult: LocateResult | null;
27
+ loadedAreas: readonly GeoArea[];
28
+ areaId: string | null;
29
+ simplifyUnit: SimplifyUnit;
30
+ simplifyStep: number;
31
+ simplifyResult: SimplifyResult | null;
32
+ gpkgResult: GeoPackageResult | null;
33
+ ellipsoid: string;
34
+ reference: LatLon | null;
35
+ latText: string;
36
+ lonText: string;
37
+ coordinateError: CoordinateError;
38
+ utm: UtmResult | null;
39
+ /** Eingabefelder der UTM-Rückrechnung (`POST /utm/geographisch`). */
40
+ zoneText: string;
41
+ eastText: string;
42
+ northText: string;
43
+ northern: boolean;
44
+ utmError: UtmInputError;
45
+ geocodeResult: GeocodeResult | null;
46
+ }
47
+ /** Eingaben der Komponente (Props). */
48
+ export interface GeoInputs {
49
+ port: GeoPort | null;
50
+ points: readonly GeoPoint[];
51
+ areas: readonly GeoArea[];
52
+ }
53
+ export interface GeoSelection {
54
+ areas: readonly GeoArea[];
55
+ area: GeoArea | null;
56
+ simplifyTolerance: number;
57
+ hitIds: ReadonlySet<string>;
58
+ canGeocode: boolean;
59
+ /** Port bietet die Rückrechnung aus UTM an. */
60
+ canFromUtm: boolean;
61
+ layers: MapLayers;
62
+ }
63
+ export declare function selectGeo(state: GeoData, inputs: GeoInputs): GeoSelection;
64
+ /** Einfache Eingabefelder, die die Oberfläche direkt setzen darf. */
65
+ export type GeoField = 'radiusMetres' | 'earthModel' | 'boundaryInside' | 'toleranceMetres' | 'simplifyStep' | 'ellipsoid' | 'latText' | 'lonText' | 'zoneText' | 'eastText' | 'northText' | 'northern';
66
+ export interface GeoControllerOptions extends GeoMapCallbacks {
67
+ inputs: () => GeoInputs;
68
+ }
69
+ export declare function createGeoController(options: GeoControllerOptions): {
70
+ simplifyArea: () => Promise<void>;
71
+ selectArea: (id: string | null) => void;
72
+ setSimplifyUnit: (unit: SimplifyUnit) => void;
73
+ loadFile: (file: Blob) => Promise<void>;
74
+ loadSource: (name: string) => Promise<void>;
75
+ applyUtm: () => Promise<void>;
76
+ refreshUtm: () => Promise<void>;
77
+ setReference: (point: LatLon | null) => Promise<void>;
78
+ applyTexts: () => Promise<void>;
79
+ geocode: (query: string) => Promise<void>;
80
+ load: () => Promise<void>;
81
+ searchRadius: () => Promise<void>;
82
+ checkLocation: () => Promise<void>;
83
+ store: Store<GeoData>;
84
+ /** Einfaches Eingabefeld setzen (Radius, Erdmodell, Rand, Toleranz, Stufe, Ellipsoid, Texte). */
85
+ setField: <K extends GeoField>(key: K, value: GeoData[K]) => void;
86
+ };
87
+ export type GeoController = ReturnType<typeof createGeoController>;
@@ -0,0 +1,6 @@
1
+ export { geoMessages, type GeoMessageKey } from './messages';
2
+ export * from './model';
3
+ export { createGeoRestPort, type GeoRestOptions } from './rest-port';
4
+ export type * from './types';
5
+ export { createLeafletView, escapeHtml as escapeMapHtml, type MapLayers, type MapView, type MapViewOptions } from './mapView';
6
+ export * from './controller';
@@ -0,0 +1,30 @@
1
+ import { AreaGeometry, GeoArea, GeoPoint, LatLon, TileSource } from './types';
2
+ export interface MapLayers {
3
+ points: readonly GeoPoint[];
4
+ areas: readonly GeoArea[];
5
+ reference: LatLon | null;
6
+ radiusMetres: number | null;
7
+ hits: ReadonlySet<string>;
8
+ selectedArea: string | null;
9
+ simplified: AreaGeometry | null;
10
+ }
11
+ export interface MapViewOptions {
12
+ center: LatLon;
13
+ zoom: number;
14
+ tiles: TileSource | null;
15
+ /** Klick auf die Karte: neuer Bezugspunkt. */
16
+ onPick: (point: LatLon) => void;
17
+ /** Beschriftung eines Punktes bzw. einer Fläche für Tooltips. */
18
+ label: (entry: GeoPoint | GeoArea) => string;
19
+ }
20
+ export interface MapView {
21
+ update(layers: MapLayers): void;
22
+ setTiles(tiles: TileSource | null): void;
23
+ /** Ausschnitt auf alle Punkte, Flächen und den Umkreis setzen. */
24
+ fit(): void;
25
+ destroy(): void;
26
+ }
27
+ /** Leaflet setzt Tooltips und Namensnennung als HTML; Daten gehen deshalb nur als Text hinein. */
28
+ export declare function escapeHtml(text: string): string;
29
+ /** Legt die Leaflet-Karte im Element an. */
30
+ export declare function createLeafletView(element: HTMLElement, options: MapViewOptions): Promise<MapView>;
@@ -0,0 +1,3 @@
1
+ /** Texte der Geo-Karte. */
2
+ export declare const geoMessages: import('..').Catalogs<"loading" | "apply" | "area" | "title" | "unit" | "noPort" | "failed" | "mapLabel" | "noTiles" | "attribution" | "fit" | "reference" | "referenceHelp" | "lat" | "lon" | "fromPoint" | "choose" | "errorlat" | "errorlon" | "utm" | "utmValue" | "utmEpsg" | "utmNote" | "ellipsoid" | "utmInput" | "utmInputHelp" | "utmZone" | "utmHemisphere" | "hemisphereNorth" | "hemisphereSouth" | "utmEast" | "utmNorth" | "utmerrorzone" | "utmerroreast" | "utmerrornorth" | "geocode" | "geocodeHelp" | "geocodeRun" | "geocodeNone" | "radius" | "radiusMetres" | "earthModel" | "recommended" | "radiusRun" | "radiusSummary" | "colName" | "colDistance" | "locate" | "boundaryInside" | "boundaryHelp" | "tolerance" | "locateRun" | "positioninnen" | "positionaussen" | "positionrand" | "contains" | "notContains" | "boundaryCase" | "boundaryExact" | "boundaryTolerance" | "ruleInside" | "ruleOutside" | "distance" | "notes" | "simplify" | "unitmeter" | "unitgrad" | "simplifyTolerance" | "simplifyVertices" | "simplifyRun" | "simplifyResult" | "simplifyDropped" | "simplifyGone" | "gpkg" | "gpkgFile" | "gpkgSource" | "gpkgLoad" | "gpkgResult" | "gpkgConverted" | "gpkgTruncated" | "gpkgErrors" | "needReference" | "needArea" | "needModel">;
3
+ export type GeoMessageKey = keyof typeof geoMessages.de;
@@ -0,0 +1,43 @@
1
+ import { Locale } from '../i18n';
2
+ import { GeoMessageKey } from './messages';
3
+ import { AreaGeometry, GeoArea, GeoPackageResult, GeoPoint, LatLon } from './types';
4
+ /** Stufen des Toleranzreglers der Vereinfachung (Meter bzw. Grad). */
5
+ export declare const TOLERANCE_STEPS: Readonly<Record<'meter' | 'grad', readonly number[]>>;
6
+ /**
7
+ * Dezimalgrad aus Texteingabe; Komma und Punkt sind als Dezimaltrenner
8
+ * erlaubt, Tausendertrennzeichen nicht. Ungültiges ergibt `null`.
9
+ */
10
+ export declare function parseDegrees(text: string): number | null;
11
+ export type CoordinateError = 'lat' | 'lon' | null;
12
+ /** Punkt aus zwei Texteingaben mit Wertebereichsprüfung. */
13
+ export declare function parseLatLon(lat: string, lon: string): {
14
+ point: LatLon | null;
15
+ error: CoordinateError;
16
+ };
17
+ /** Meter aus Texteingabe (Komma oder Punkt, keine Tausendertrennung); Ungültiges ergibt `null`. */
18
+ export declare function parseMetres(text: string): number | null;
19
+ export type UtmInputError = 'zone' | 'east' | 'north' | null;
20
+ export interface UtmInput {
21
+ zone: number;
22
+ ost: number;
23
+ nord: number;
24
+ }
25
+ /** UTM-Eingabe mit Wertebereichsprüfung: Zone 1–60, Ostwert 0–1 000 000 m, Nordwert 0–10 000 000 m. */
26
+ export declare function parseUtm(zone: string, east: string, north: string): {
27
+ value: UtmInput | null;
28
+ error: UtmInputError;
29
+ };
30
+ /** Text der Fehlermeldung einer UTM-Eingabe. */
31
+ export declare function utmErrorKey(error: Exclude<UtmInputError, null>): GeoMessageKey;
32
+ /** Entfernung sprachabhängig: unter 1 km in Metern, sonst in Kilometern mit zwei Stellen. */
33
+ export declare function formatDistance(metres: number, locale: Locale): string;
34
+ /** Grad mit sechs Nachkommastellen (≈ 0,1 m). */
35
+ export declare function formatDegrees(value: number, locale: Locale): string;
36
+ /** Rechts-/Hochwert in Metern mit zwei Nachkommastellen, ohne Tausendertrennung. */
37
+ export declare function formatMetres(value: number, locale: Locale): string;
38
+ /** Anzahl der Stützpunkte einer Fläche (Schlusspunkte mitgezählt). */
39
+ export declare function vertexCount(geometry: AreaGeometry): number;
40
+ /** Flächen aus einer GeoPackage-Antwort; Kennungen erhalten die Herkunft als Präfix. */
41
+ export declare function areasFromGeoPackage(result: GeoPackageResult, origin: string): GeoArea[];
42
+ /** Bezeichnung für Listen: Name, sonst Kennung. */
43
+ export declare function displayName(entry: GeoPoint | GeoArea): string;
@@ -0,0 +1,12 @@
1
+ import { RestOptions } from '@auditcore/common';
2
+ import { GeoPort } from './types';
3
+ export interface GeoRestOptions extends RestOptions {
4
+ /**
5
+ * Adresssuche über `POST /geocode` anbieten. Standard `false`: ohne
6
+ * ausdrückliche Freigabe sendet die Oberfläche keine Adressen, auch wenn
7
+ * der Server einen Geocoder angeschlossen hat.
8
+ */
9
+ geocoding?: boolean;
10
+ }
11
+ /** Port auf den REST-Vertrag von `auditcore_geo.web` (Starlette oder FastAPI). */
12
+ export declare function createGeoRestPort(options: GeoRestOptions): GeoPort;