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
14type TextDecorationLine = "none" | "underline" | "line-through";
15
16type TextDecorationStyle = "solid" | "double" | "dotted" | "dashed";
17
18export type NativeFontWeight =
19 | "normal"
20 | "bold"
21 | "ultraLight"
22 | "light"
23 | "medium"
24 | "semibold"
25 | "heavy";
26
27type FontStyle = "normal" | "italic";
28
29type TextAlign = "auto" | "left" | "right" | "center" | "justify";
30
31interface NativeProps extends ViewProps {
32 text: string;
33 color?: ColorValue;
34 fontSize?: Float;
35 fontStyle?: WithDefault<FontStyle, "normal">;
36 fontWeight?: WithDefault<NativeFontWeight, "normal">;
37 fontFamily?: string;
38 letterSpacing?: Float;
39 lineHeight?: Float;
40 textDecorationLine?: WithDefault<TextDecorationLine, "none">;
41 textDecorationStyle?: WithDefault<TextDecorationStyle, "solid">;
42 textDecorationColor?: ColorValue;
43 textAlign?: WithDefault<TextAlign, "auto">;
44 shadowRadius?: WithDefault<Float, 0>;
45 onPress?: BubblingEventHandler<TargetedEvent>;
46 onLongPress?: BubblingEventHandler<TargetedEvent>;
47}
48
49export default codegenNativeComponent<NativeProps>("T3MarkdownTextRun", {
50 excludedPlatforms: ["android"],
51});