|
1 |
| -import React from 'react'; |
2 |
| -import { StyleProp, TextStyle } from 'react-native'; |
| 1 | +import { PureComponent } from 'react'; |
| 2 | +import { StyleProp, TextStyle, TextProps } from 'react-native'; |
| 3 | +import { Match } from 'autolinker'; |
3 | 4 |
|
4 | 5 | export interface AutolinkProps {
|
5 | 6 | email?: boolean;
|
6 |
| - hashtag?: false|'facebook'|'instagram'|'twitter'; |
| 7 | + hashtag?: false | 'facebook' | 'instagram' | 'twitter'; |
7 | 8 | latlng?: boolean;
|
8 | 9 | linkStyle?: StyleProp<TextStyle>;
|
9 |
| - mention?: false|'instagram'|'soundcloud'|'twitter'; |
10 |
| - onPress?: (url: string, match: string) => void; |
11 |
| - onLongPress?: (url: string, match: string) => void; |
12 |
| - phone?: boolean|string; |
13 |
| - renderLink?: (text: string, match: string, index: number) => void; |
| 10 | + mention?: false | 'instagram' | 'soundcloud' | 'twitter'; |
| 11 | + onPress?: (url: string, match: Match) => void; |
| 12 | + onLongPress?: (url: string, match: Match) => void; |
| 13 | + phone?: boolean | 'text'; |
| 14 | + renderLink?: (text: string, match: Match, index: number) => void; |
14 | 15 | showAlert?: boolean;
|
15 | 16 | stripPrefix?: boolean;
|
16 | 17 | stripTrailingSlash?: boolean;
|
17 |
| - style?: StyleProp<TextStyle>; |
18 | 18 | text: string;
|
19 | 19 | truncate?: number;
|
20 | 20 | truncateChars?: string;
|
21 |
| - truncateLocation?: 'end'|'middle'|'smart'; |
| 21 | + truncateLocation?: 'end' | 'middle' | 'smart'; |
| 22 | + /** |
| 23 | + * @deprecated Use mention |
| 24 | + */ |
22 | 25 | twitter?: boolean;
|
23 |
| - url?: boolean | { schemeMatches?: boolean; wwwMatches?: boolean; tldMatches?: boolean; }; |
| 26 | + url?: |
| 27 | + | boolean |
| 28 | + | { schemeMatches?: boolean; wwwMatches?: boolean; tldMatches?: boolean }; |
24 | 29 | webFallback?: boolean;
|
25 | 30 | }
|
26 | 31 |
|
27 |
| -export default class Autolink extends React.PureComponent<AutolinkProps> { |
28 |
| -} |
29 |
| - |
| 32 | +export default class Autolink extends PureComponent< |
| 33 | + AutolinkProps & TextProps |
| 34 | +> {} |
0 commit comments