import { default as React } from 'react'; export interface HexHighlight { /** Start byte offset (inclusive) */ start: number; /** End byte offset (inclusive) */ end: number; /** Highlight color (CSS color) */ color: string; /** Optional label for the highlight region */ label?: string; } /** * Named region for structural packet analysis (e.g., CCSDS Primary Header, * Secondary Header, User Data). Regions provide persistent background color * and a legend entry, unlike transient highlights. */ export interface HexRegion { /** Start byte offset (inclusive) */ start: number; /** End byte offset (exclusive) */ end: number; /** Region display name (e.g., "Primary Header") */ label: string; /** Background fill color (CSS rgba recommended) */ color: string; /** Border/accent color for the region */ borderColor?: string; } /** * A decoded field within the packet payload for the fields table. * Enables cross-highlighting: hover a field row → highlight its bytes, * hover hex bytes → highlight the corresponding field row. */ export interface DecodedField { /** Field name */ name: string; /** Decoded value (displayed via toString) */ value: string | number | boolean | null; /** Engineering units (e.g., "°C", "V", "rpm") */ unit?: string; /** Byte offset within the packet where this field starts */ byteOffset?: number; /** Size in bits */ sizeBits?: number; /** Optional description / tooltip */ description?: string; } /** * Packet header key-value pairs shown in a collapsible summary panel. * Supports CCSDS-style primary + secondary header display. */ export interface PacketHeaderEntry { /** Label (e.g., "APID", "Sequence Count", "Spacecraft ID") */ label: string; /** Value */ value: string | number; /** Render value in monospace font */ mono?: boolean; } /** Pre-defined region color palette for space packet headers */ export declare const REGION_COLORS: { readonly primary: "rgba(96, 165, 250, 0.15)"; readonly secondary: "rgba(168, 85, 247, 0.15)"; readonly tertiary: "rgba(251, 191, 36, 0.15)"; readonly userData: "rgba(34, 197, 94, 0.15)"; readonly error: "rgba(255, 56, 56, 0.15)"; }; export declare const REGION_BORDER_COLORS: { readonly primary: "rgba(96, 165, 250, 0.5)"; readonly secondary: "rgba(168, 85, 247, 0.5)"; readonly tertiary: "rgba(251, 191, 36, 0.5)"; readonly userData: "rgba(34, 197, 94, 0.5)"; readonly error: "rgba(255, 56, 56, 0.5)"; }; export type ByteGrouping = 1 | 2 | 4 | 8; export type OffsetBase = "hex" | "decimal"; export type Endianness = "big" | "little"; export interface HexViewerProps { /** Binary data to display */ data: Uint8Array | number[]; /** Bytes per row (default: 16) */ bytesPerRow?: 8 | 16 | 32; /** Byte grouping for hex display (default: 1) */ byteGrouping?: ByteGrouping; /** Offset display base (default: 'hex') */ offsetBase?: OffsetBase; /** Highlighted byte regions (transient, e.g., search results or field hover) */ highlights?: HexHighlight[]; /** Named structural regions (persistent background, e.g., Primary/Secondary Header) */ regions?: HexRegion[]; /** Decoded fields for the fields table (cross-highlights with hex bytes) */ decodedFields?: DecodedField[]; /** Packet header entries for the summary panel */ packetHeaders?: PacketHeaderEntry[]; /** External hover highlight range (for cross-component linking) */ externalHighlight?: { start: number; end: number; } | null; /** Whether to show the ASCII column (default: true) */ showAscii?: boolean; /** Whether to show the offset column (default: true) */ showOffset?: boolean; /** Whether to show the status/info bar (default: true) */ showStatusBar?: boolean; /** Whether to show the search bar (default: true) */ showSearch?: boolean; /** Whether to show the toolbar (default: true) */ showToolbar?: boolean; /** Whether to show the decoded fields table (default: true if decodedFields provided) */ showFieldsTable?: boolean; /** Whether to show the packet header summary (default: true if packetHeaders provided) */ showHeaderSummary?: boolean; /** * Height of the viewer (default: 400). * When constrained, HexViewer enables outer scroll fallback so expanded * panels (headers/decoded fields) never trap lower sections. */ height?: number | string; /** Title for the viewer */ title?: string; /** Whether data is streaming (auto-scroll to bottom) */ streaming?: boolean; /** Endianness for multi-byte interpretation (default: 'big') */ endianness?: Endianness; /** Called when byte selection changes */ onSelectionChange?: (start: number, end: number) => void; /** Called when a byte is clicked */ onByteClick?: (offset: number, value: number) => void; /** Called when hovering a byte (for external cross-highlighting) */ onByteHover?: (byteIndex: number) => void; /** Called when mouse leaves hex area */ onByteLeave?: () => void; /** CSS class name */ className?: string; /** Show outer container border (default: true). Set false when embedded inside a Container/card. */ bordered?: boolean; /** Custom style overrides for the outer container */ style?: React.CSSProperties; } export declare function HexViewer({ data: rawData, bytesPerRow, byteGrouping, offsetBase, highlights, regions, decodedFields, packetHeaders, externalHighlight, showAscii, showOffset, showStatusBar, showSearch, showToolbar, showFieldsTable, showHeaderSummary, height, title, streaming, endianness, onSelectionChange, onByteClick, onByteHover, onByteLeave, className, bordered, style: styleProp, }: HexViewerProps): React.ReactElement; export default HexViewer;