All files / src/types widget-props.ts

0% Statements 0/0
0% Branches 1/1
0% Functions 1/1
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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                                                                                                                                                                       
import { SecurityLevel } from "./cia";
 
/**
 * Standard interface for components that use security levels
 */
export interface WithSecurityLevelProps {
  /**
   * The selected availability level
   */
  availabilityLevel: SecurityLevel;
 
  /**
   * The selected integrity level
   */
  integrityLevel: SecurityLevel;
 
  /**
   * The selected confidentiality level
   */
  confidentialityLevel: SecurityLevel;
 
  /**
   * Optional callback for availability level changes
   */
  onAvailabilityChange?: (level: SecurityLevel) => void;
 
  /**
   * Optional callback for integrity level changes
   */
  onIntegrityChange?: (level: SecurityLevel) => void;
 
  /**
   * Optional callback for confidentiality level changes
   */
  onConfidentialityChange?: (level: SecurityLevel) => void;
}
 
/**
 * Common props shared by all widgets
 */
export interface CommonWidgetProps {
  /**
   * Optional CSS class name
   */
  className?: string;
 
  /**
   * Optional test ID for automated testing
   */
  testId?: string;
}
 
/**
 * Combined interface for widgets that use security levels
 */
export type SecurityWidgetProps = WithSecurityLevelProps & CommonWidgetProps;
 
/**
 * Base interface for components that impact security levels
 */
export interface ComponentImpactBaseProps {
  /**
   * @deprecated Use specific *Level properties instead
   */
  level?: SecurityLevel;
 
  /**
   * Current availability security level
   */
  availabilityLevel: SecurityLevel;
 
  /**
   * Current integrity security level
   */
  integrityLevel: SecurityLevel;
 
  /**
   * Current confidentiality security level
   */
  confidentialityLevel: SecurityLevel;
 
  // ...other existing properties...
}