Skip to content

Commit 3def6c4

Browse files
ArnaudBarrejoshswan
authored andcommitted
Update types (joshswan#44)
1 parent c6378ab commit 3def6c4

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

src/index.d.ts

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
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';
34

45
export interface AutolinkProps {
56
email?: boolean;
6-
hashtag?: false|'facebook'|'instagram'|'twitter';
7+
hashtag?: false | 'facebook' | 'instagram' | 'twitter';
78
latlng?: boolean;
89
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;
1415
showAlert?: boolean;
1516
stripPrefix?: boolean;
1617
stripTrailingSlash?: boolean;
17-
style?: StyleProp<TextStyle>;
1818
text: string;
1919
truncate?: number;
2020
truncateChars?: string;
21-
truncateLocation?: 'end'|'middle'|'smart';
21+
truncateLocation?: 'end' | 'middle' | 'smart';
22+
/**
23+
* @deprecated Use mention
24+
*/
2225
twitter?: boolean;
23-
url?: boolean | { schemeMatches?: boolean; wwwMatches?: boolean; tldMatches?: boolean; };
26+
url?:
27+
| boolean
28+
| { schemeMatches?: boolean; wwwMatches?: boolean; tldMatches?: boolean };
2429
webFallback?: boolean;
2530
}
2631

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

Comments
 (0)