File size: 1,062 Bytes
95eb75a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
/**
 * autoFixTypes.ts — S550: tipi puri estratti da autoFix.ts
 *
 * Contiene solo TypeScript interfaces senza dipendenze runtime.
 * Permette import type-only senza pull-in di autoFix.ts
 * (sessionStorage, FIX_ACTIONS, runFix, Dexie dynamic import, ecc.).
 *
 * Consumato da autoFix.ts (re-esporta per backward compat) e
 * da componenti UI (RuntimeDiagnosticsPanel, AutoFixPanel) che usano
 * solo i tipi per tipare props/state.
 */

import type { DiagType } from "./autoDiagnostics";

export interface FixResult {
  ok:      boolean;
  message: string;
  detail?: string;
}

export interface FixHistoryEntry {
  at:       number;
  fixId:    string;
  fixLabel: string;
  result:   FixResult;
}

export interface FixAction {
  id:          string;
  label:       string;
  description: string;
  applyTo:     DiagType[] | "all";
  patterns?:   RegExp[];
  dangerous:   boolean;
  run:         () => Promise<FixResult>;
}

export interface HealthCheck {
  id:     string;
  label:  string;
  ok:     boolean | "warn";
  value:  string;
  fixId?: string;
}