Skip to content

Commit 04237c6

Browse files
committed
typings: init at 2018-01-27
add typescript support by integrating the typings to the repository
1 parent d0afedd commit 04237c6

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"author": "Tasti Zakarie",
77
"license": "MIT",
88
"main": "dist/index.js",
9+
"types": "src/index.d.ts",
910
"repository": {
1011
"type": "git",
1112
"url": "https://github.com/tasti/react-linkify.git"

src/index.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import * as React from "react";
2+
3+
export interface Match {
4+
index: number;
5+
lastIndex: number;
6+
text: string;
7+
url: string;
8+
}
9+
10+
export interface LinkifyProps {
11+
children: React.ReactNode;
12+
componentDecorator?: (
13+
decoratedHref: string,
14+
decoratedText: string,
15+
key: number
16+
) => React.ReactNode;
17+
hrefDecorator?: (text: string) => string;
18+
matchDecorator?: (text: string) => Match[];
19+
textDecorator?: (text: string) => string;
20+
}
21+
22+
export default class Linkify extends React.Component<LinkifyProps, {}> {}

0 commit comments

Comments
 (0)