1export interface NativeMarkdownTextStyle {
2 readonly selectionColor?: string;
3 readonly selectionHandleColor?: string;
4 readonly color: string;
5 readonly strongColor: string;
6 readonly mutedColor: string;
7 readonly linkColor: string;
8 readonly inlineCodeColor: string;
9 readonly codeColor: string;
10 readonly codeBackgroundColor: string;
11 readonly codeBlockBackgroundColor: string;
12 readonly fileTextColor: string;
13 readonly skillTextColor: string;
14 readonly quoteMarkerColor: string;
15 readonly dividerColor: string;
16 readonly contextChipBorderColor?: string;
17 readonly fontSize: number;
18 readonly lineHeight: number;
19 readonly fontFamily: string;
20 readonly headingFontFamily: string;
21 readonly boldFontFamily: string;
22 readonly headingFontSizes?: ReadonlyArray<number>;
23}
24
25export interface SelectableMarkdownSkill {
26 readonly name: string;
27 readonly displayName?: string | null;
28}
29
30export interface MarkdownImageRequest {
31 readonly href: string;
32 readonly alt: string | null;
33 readonly title: string | null;
34}
35
36/**
37 * App-supplied renderer for markdown images. The module cannot load
38 * workspace-relative image paths itself — the host app resolves them (for
39 * example through a signed asset URL) and returns the element to show.
40 * Returning null keeps Enriched's native media rendering.
41 */
42export type MarkdownImageRenderer = (image: MarkdownImageRequest) => import("react").ReactNode;
43
44export type MarkdownImageSourceResolver = (
45 image: MarkdownImageRequest,
46) =>
47 | { uri: string; headers?: Record<string, string> }
48 | null
49 | Promise<{ uri: string; headers?: Record<string, string> } | null>;
50
51export interface MarkdownFileContextMenuAction {
52 readonly id: string;
53 readonly title: string;
54 readonly disabled?: boolean;
55}
56
57export interface MarkdownFileContextMenu {
58 readonly title?: string;
59 readonly actions: ReadonlyArray<MarkdownFileContextMenuAction>;
60}
61
62export interface MarkdownLinkCustomization {
63 readonly iconTintColor?: string;
64 readonly color?: string;
65 readonly label?: string;
66 readonly icon?: import("react-native").ImageSourcePropType;
67}
68
69export interface SelectableMarkdownTextProps {
70 readonly markdown: string;
71 readonly textStyle: NativeMarkdownTextStyle;
72 readonly skills?: ReadonlyArray<SelectableMarkdownSkill>;
73 readonly preserveSoftBreaks?: boolean;
74 readonly onLinkPress?: (href: string) => void;
75 readonly fileContextMenu?: (href: string) => MarkdownFileContextMenu | undefined;
76 readonly onFileContextMenuAction?: (href: string, actionId: string) => void;
77 readonly linkCustomization?: (href: string) => MarkdownLinkCustomization | undefined;
78 readonly contextClipboardFragment?: string;
79 readonly renderImage?: MarkdownImageRenderer;
80 readonly resolveImageSource?: MarkdownImageSourceResolver;
81 readonly onImagePress?: (href: string) => void;
82 readonly marginTop?: number;
83 readonly marginBottom?: number;
84}