Open History to see the last commit
1import type { ColorValue, ViewProps } from "react-native";
2import type {
3 BubblingEventHandler,
4 Float,
5 Int32,
6 WithDefault,
7} from "react-native/Libraries/Types/CodegenTypes";
8import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNativeComponent";
9
10interface TargetedEvent {
11 target: Int32;
12}
13
14interface ContextMenuActionEvent extends TargetedEvent {
15 actionIdentifier: string;
16}
17
18type TextDecorationLine = "none" | "underline" | "line-through";
19
20type TextDecorationStyle = "solid" | "double" | "dotted" | "dashed";
21
22export type NativeFontWeight =
23 | "normal"
24 | "bold"
25 | "ultraLight"
26 | "light"
27 | "medium"
28 | "semibold"
29 | "heavy";
30
31type FontStyle = "normal" | "italic";
32
33type TextAlign = "auto" | "left" | "right" | "center" | "justify";
34
35interface NativeProps extends ViewProps {
36 text: string;
37 color?: ColorValue;
38 fontSize?: Float;
39 fontStyle?: WithDefault<FontStyle, "normal">;
40 fontWeight?: WithDefault<NativeFontWeight, "normal">;
41 fontFamily?: string;
42 letterSpacing?: Float;
43 lineHeight?: Float;
44 textDecorationLine?: WithDefault<TextDecorationLine, "none">;
45 textDecorationStyle?: WithDefault<TextDecorationStyle, "solid">;
46 textDecorationColor?: ColorValue;
47 textAlign?: WithDefault<TextAlign, "auto">;
48 shadowRadius?: WithDefault<Float, 0>;
49 contextMenuConfig?: string;
50 onPress?: BubblingEventHandler<TargetedEvent>;
51 onLongPress?: BubblingEventHandler<TargetedEvent>;
52 onContextMenuAction?: BubblingEventHandler<ContextMenuActionEvent>;
53}
54
55export default codegenNativeComponent<NativeProps>("T3MarkdownTextRun", {
56 excludedPlatforms: ["android"],
57});