UNPKG

1.28 kBTypeScriptView Raw
1import * as React from 'react';
2import { StyleProp, Text as NativeText, TextStyle } from 'react-native';
3import type { VariantProp } from './types';
4import type { ThemeProp } from '../../types';
5export declare type Props<T> = React.ComponentProps<typeof NativeText> & {
6 /**
7 * @supported Available in v5.x with theme version 3
8 *
9 * Variant defines appropriate text styles for type role and its size.
10 * Available variants:
11 *
12 * Display: `displayLarge`, `displayMedium`, `displaySmall`
13 *
14 * Headline: `headlineLarge`, `headlineMedium`, `headlineSmall`
15 *
16 * Title: `titleLarge`, `titleMedium`, `titleSmall`
17 *
18 * Label: `labelLarge`, `labelMedium`, `labelSmall`
19 *
20 * Body: `bodyLarge`, `bodyMedium`, `bodySmall`
21 */
22 variant?: VariantProp<T>;
23 children: React.ReactNode;
24 theme?: ThemeProp;
25 style?: StyleProp<TextStyle>;
26};
27export declare type TextRef = React.ForwardedRef<{
28 setNativeProps(args: Object): void;
29}>;
30declare type TextComponent<T> = (props: Props<T> & {
31 ref?: React.RefObject<TextRef>;
32}) => JSX.Element;
33declare const Component: TextComponent<never>;
34export declare const customText: <T>() => TextComponent<T>;
35export default Component;
36//# sourceMappingURL=Text.d.ts.map
\No newline at end of file