Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

T3MarkdownTextRunNativeComponent.ts

55 lines1.6 KB

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