import { type TextStyle, type ViewStyle } from 'react-native'; import { type RadiusValue } from '../../core/theme/radius'; import type { PlatformBlocksTheme } from '../../core/theme/types'; import type { CodeBlockColorOverrides, CodeBlockToken, CodeBlockVariant } from './types'; /** `colors` after theme tokens (`primary.6`, `muted`) are resolved to real colors. */ export type ResolvedCodeBlockColors = { background?: string; border?: string; text?: string; highlightBackground?: string; tokenOverrides?: Partial>; }; /** Corner rounding at the two ends of a highlighted run. */ export declare const HIGHLIGHT_RADIUS = 4; /** Where a highlighted line sits in its run — the ends round, the middle does not. */ export type HighlightCorners = { isFirst: boolean; isLast: boolean; }; /** Corner radii for one line of a run, so the run reads as a single block. */ export declare const getHighlightCornerRadii: ({ isFirst, isLast }: HighlightCorners) => { borderTopLeftRadius: number; borderTopRightRadius: number; borderBottomLeftRadius: number; borderBottomRightRadius: number; }; /** Resting corner radius of the code surface — matches `radius="xl"`. */ export declare const DEFAULT_CODE_RADIUS: RadiusValue; /** Resolves the public `colors` prop into concrete colors, once per theme change. */ export declare const resolveCodeBlockColors: (theme: PlatformBlocksTheme, overrides?: CodeBlockColorOverrides) => ResolvedCodeBlockColors; /** * The code surface color, resolved in one place: the styles need it to paint, * and the syntax palette needs it to measure token contrast against. * * Code reads as a recessed well inside whatever contains it, which is exactly * what `backgrounds.subtle` is for; a terminal drops one step further to the * bottom of the elevation ladder. Both follow a custom theme instead of pinning * the panel to a slate palette the rest of the UI never uses. */ export declare const resolveCodeSurface: (theme: PlatformBlocksTheme, variant: CodeBlockVariant, overrides?: ResolvedCodeBlockColors) => string; /** Hairline around the code surface — the theme's own border, or the skin's. */ export declare const resolveCodeBorder: (theme: PlatformBlocksTheme, variant: CodeBlockVariant, overrides?: ResolvedCodeBlockColors) => string; export type CodeBlockStyles = ReturnType; export declare const getCodeBlockStyles: (theme: PlatformBlocksTheme, fullWidth: boolean, variant: CodeBlockVariant, overrides?: ResolvedCodeBlockColors, radius?: RadiusValue | undefined, withBorder?: boolean) => { container: ViewStyle; codeBlock: ViewStyle; title: TextStyle; codeText: TextStyle; /** * A highlighted line is *painted*, never laid out: the tint adds no border, * padding or margin, so its code sits on exactly the same column as the * lines above and below it. * * `corners` rounds only the outer edges of a run, so lines 5-9 read as one * block rather than five stacked pills. */ highlightedLine: (highlightColors: { background: string; }, corners?: HighlightCorners) => { borderTopLeftRadius: number; borderTopRightRadius: number; borderBottomLeftRadius: number; borderBottomRightRadius: number; backgroundColor: string; }; headerBar: ViewStyle; inlineTitleRow: ViewStyle; };