react-linkify icon indicating copy to clipboard operation
react-linkify copied to clipboard

typings for react-linkify

Open droegier opened this issue 6 years ago • 2 comments

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> {
    }
}

droegier avatar Nov 27 '17 12:11 droegier

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> {}
}

iimos avatar Jul 11 '19 12:07 iimos

Also see #62 and #83 for relevant pull requests.

zaunerc avatar Sep 02 '19 10:09 zaunerc