feat(viz): bit manipulation types

This commit is contained in:
2025-09-03 23:27:24 +01:00
parent 97f479a5cc
commit eae444df77

View File

@@ -99,6 +99,8 @@ export interface DataState {
tries?: TrieState[];
// Union-Find support
unionFind?: UnionFindState[];
// Bit Manipulation support
bitManipulation?: BitManipulationState[];
}
/** Single step in the visualization */
@@ -382,6 +384,28 @@ export interface TrieState {
searchIndex?: number; // Current character index
}
// ============================================
// Bit Manipulation Types
// ============================================
/** State of a bit representation display */
export interface BitState {
id: string;
value: number;
bits: string; // Binary string like "0010"
label?: string;
state: 'normal' | 'highlighted' | 'comparing' | 'result' | 'cancelled';
}
/** Complete bit manipulation state */
export interface BitManipulationState {
id: string;
operands: BitState[];
operation?: 'XOR' | 'AND' | 'OR' | 'NOT';
result?: BitState;
label?: string;
}
// ============================================
// Union-Find Types
// ============================================