Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/react-linkify

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/react-linkify

TypeScript definitions for react-linkify

  • 1.0.4
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
86K
increased by9.68%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/react-linkify

Summary

This package contains type definitions for react-linkify (http://tasti.github.io/react-linkify/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-linkify.

index.d.ts

import * as React from "react";

/**
 * Matching information
 */
export interface MatchInfo {
    /**
     * Link schema, can be empty for fuzzy links, or for protocol-neutral links
     */
    schema: string;
    /**
     * Offset of matched text
     */
    index: number;
    /**
     * Index of next char after the end of the matched text
     */
    lastIndex: number;
    /**
     * Normalized text
     */
    text: string;
    /**
     * Link, generated from matched text
     */
    url: string;
}

export interface Props {
    children: React.ReactNode;
    /**
     * Custom anchor tag creator
     * Default to using exisint <a> tag with the provided href={decoratedHref}, key={key}
     * and children={decoratedText}, without additional styling
     */
    componentDecorator?: ((decoratedHref: string, decoratedText: string, key: number) => React.ReactNode) | undefined;
    /**
     * Custom href decorator or mapper on the matched (url) href
     * Default to no transformation
     */
    hrefDecorator?: ((urlHref: string) => string) | undefined;
    /**
     * Custom matcher for (url), that returns each match with the matching information
     * Default to https://github.com/markdown-it/linkify-it's LinkifyIt().tlds(tlds).match
     */
    matchDecorator?: ((text: string) => MatchInfo[] | null) | undefined;
    /**
     * Custom text decorator or mapper on the matched (url) text
     * Default to no transformation
     */
    textDecorator?: ((urlText: string) => string) | undefined;
}

export default class ReactLinkify extends React.Component<Props> {}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/react

Credits

These definitions were written by Michael James, Jacky Wang, and Akhil Stanislavose.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc