From e57f22ad25ae4de933f90277365936f0ac81c196 Mon Sep 17 00:00:00 2001 From: Sergei Butko Date: Tue, 9 Oct 2018 22:43:53 +0300 Subject: [PATCH] Add TypeScript definition file --- index.d.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..d2605bc --- /dev/null +++ b/index.d.ts @@ -0,0 +1,21 @@ +declare module "react-native-hyperlinked-text" { + + import {TextStyle} from "react-native"; + + export interface ILinkDef { + regex: RegExp; + style?: TextStyle; + replaceText?: (orig: string, text: string, url: string) => string; + onPress?: (orig: string, text: string, url: string) => void; + } + + interface IProps { + style?: TextStyle; + linkDefs?: ILinkDef[]; + + } + + export default class HyperlinkedText extends React.Component { + static _openWebUrl(url: string): void; + } +}