react-linkify
react-linkify copied to clipboard
typings for react-linkify
I needed typings to use this library in my React app using Typescript, but couldn't find any. I didn't want to create a perfect file, but just needed something that works. This "index.d.ts" did it for me. In case anyone wants to re-use this or improve it, so it may be included as part of this library : feel free.
declare module 'react-linkify' {
export default class Linkify extends React.Component<any, any> {
}
}
type Props = {
children: React.ReactNode,
componentDecorator?: (decoratedHref: string, decoratedText: string, key: number) => React.ReactNode,
hrefDecorator?: (href: string) => string,
matchDecorator?: (text: string) => Array<Object>,
textDecorator?: (text: string) => string,
};
declare module 'react-linkify' {
export default class Linkify extends React.Component<Props> {}
}
Also see #62 and #83 for relevant pull requests.