Skip to main content

UrlMatcher

Hierarchy

Index

Constructors

constructor

Properties

factory

factory: null | ComponentType<UrlProps>

greedy

greedy: boolean

inverseName

inverseName: string

options

propName

propName: string

Methods

asTag

  • asTag(): string

createElement

  • createElement(children: ChildrenNode, props: UrlProps): Node
  • Attempts to create a React element using a custom user provided factory, or the default matcher factory.

doMatch

  • doMatch<T>(string: string, pattern: string | RegExp, callback: MatchCallback<T>, isVoid?: boolean): null | MatchResponse<T>
  • Trigger the actual pattern match and package the matched response through a callback.


    Type parameters

    • T

handleMatches

  • handleMatches(matches: string[]): UrlMatch
  • Package the matched response.

match

  • match(string: string): null | MatchResponse<UrlMatch>

onAfterParse

  • onAfterParse(content: Node[], props: UrlProps): Node[]
  • Callback triggered after parsing.

onBeforeParse

  • onBeforeParse(content: string, props: UrlProps): string
  • Callback triggered before parsing.

replaceWith

  • replaceWith(children: ChildrenNode, props: UrlProps): Node