diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..1def635 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,22 @@ +import * as React from "react"; + +export interface Match { + index: number; + lastIndex: number; + text: string; + url: string; +} + +export interface LinkifyProps { + children: React.ReactNode; + componentDecorator?: ( + decoratedHref: string, + decoratedText: string, + key: number + ) => React.ReactNode; + hrefDecorator?: (text: string) => string; + matchDecorator?: (text: string) => Match[]; + textDecorator?: (text: string) => string; +} + +export default class Linkify extends React.Component {} diff --git a/package.json b/package.json index 6b83a4c..10bc0b5 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "author": "Tasti Zakarie", "license": "MIT", "main": "dist/index.js", - "files": ["dist"], + "types": "index.d.ts", + "files": ["dist", "index.d.ts"], "repository": { "type": "git", "url": "https://github.com/tasti/react-linkify.git"