import type { CSSProperties, ReactNode } from 'react'; import type { SyntaxAdapter, Token } from './adapters/types'; import type { DisplayItem, FoldRegion } from './lib/foldUtils'; export type CodeSnippetSize = 'sm' | 'md' | 'lg'; export type LineColor = 'danger' | 'warning' | 'info' | 'success' | 'brand' | 'ai' | 'neutral'; export type LineTextStyle = 'regular' | 'medium' | 'italic'; export type LineRange = { /** 0-based inclusive start character index */ start: number; /** 0-based exclusive end character index */ end: number; /** Color applied to the range text (bold + colored). Falls back to the line's color. */ color?: LineColor; }; export type LineConfig = { /** Color for the line indicator, background, and text */ color?: LineColor; /** Character ranges within the line to highlight with colored bold text */ ranges?: LineRange[]; /** Prefix content (text, icon, etc.) displayed before the line content */ prefix?: ReactNode; /** Text style variant for the line */ textStyle?: LineTextStyle; /** Additional CSS class name for the line text */ className?: string; /** Inline styles for the line text */ style?: CSSProperties; }; export type CodeSnippetContextValue = { code: string; language?: TLanguage; tokens: Token[][] | null; isLoading: boolean; size: CodeSnippetSize; wrapLines: boolean; startingLineNumber: number; /** When true, gutter elements (color stick, line numbers, prefix) should be rendered inline with code (used when wrapLines is true) */ inlineGutter: boolean; /** When true, show line numbers (either in gutter or inline depending on inlineGutter) */ showLineNumbers: boolean; lines: Map; totalLines: number; /** All display items (post-fold, pre-clip). Used for ShowMore counting. */ displayItems: DisplayItem[]; /** Display items clipped to maxLines. All rendering components should iterate this. */ visibleDisplayItems: DisplayItem[]; folds: FoldRegion[]; /** Fold regions indexed by their start line for O(1) lookup */ foldByStartLine: Map; collapsedFolds: Set; toggleFold: (foldId: string) => void; isExpanded: boolean; maxLines: number; isFullscreen: boolean; copyToClipboard: () => Promise; setWrapLines: (wrap: boolean) => void; setIsExpanded: (expanded: boolean) => void; setIsFullscreen: (fullscreen: boolean) => void; adapter: SyntaxAdapter | null; }; /** * Minimum number of hidden lines required to show the "Show more" button. * If fewer lines are hidden, all lines are shown instead — collapsing * 1–2 lines behind a button adds clutter without saving meaningful space. */ export declare const MIN_HIDDEN_LINES_THRESHOLD = 3; export declare const CodeSnippetContext: import("react").Context | null>; export type AdapterContextValue = { adapter: SyntaxAdapter; }; export declare const AdapterContext: import("react").Context | null>;