From 8dcab970da6c53e809dc98e530573edb5ee7f34a Mon Sep 17 00:00:00 2001 From: Hendrik Schaeidt Date: Wed, 18 Apr 2018 19:03:18 +0200 Subject: [PATCH] typings: init at 2018-01-27 add typescript support by integrating the typings to the repository --- index.d.ts | 22 ++++++++++++++++++++++ package.json | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 index.d.ts 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 acf25e6..864d3d2 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "author": "Tasti Zakarie", "license": "MIT", "main": "dist/index.js", + "types": "index.d.ts", + "files": ["dist", "index.d.ts"], "repository": { "type": "git", "url": "https://github.com/tasti/react-linkify.git"