Skip to content

Commit efca9f4

Browse files
mo22joshswan
authored andcommitted
add typescript typings (#41)
1 parent ca99144 commit efca9f4

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Autolinking component for React Native",
55
"author": "Josh Swan <[email protected]>",
66
"main": "src/index.js",
7+
"types": "src/index.d.ts",
78
"license": "MIT",
89
"repository": {
910
"type": "git",

src/index.d.ts

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

0 commit comments

Comments
 (0)