1 | import { AnchorTagBuilder } from "../anchor-tag-builder";
|
2 | import { Match } from "../match/match";
|
3 | /**
|
4 | * @abstract
|
5 | * @class Autolinker.matcher.Matcher
|
6 | *
|
7 | * An abstract class and interface for individual matchers to find matches in
|
8 | * an input string with linkified versions of them.
|
9 | *
|
10 | * Note that Matchers do not take HTML into account - they must be fed the text
|
11 | * nodes of any HTML string, which is handled by {@link Autolinker#parse}.
|
12 | */
|
13 | export declare abstract class Matcher {
|
14 | /**
|
15 | * @cfg {Autolinker.AnchorTagBuilder} tagBuilder (required)
|
16 | *
|
17 | * Reference to the AnchorTagBuilder instance to use to generate HTML tags
|
18 | * for {@link Autolinker.match.Match Matches}.
|
19 | */
|
20 | private __jsduckDummyDocProp;
|
21 | protected tagBuilder: AnchorTagBuilder;
|
22 | /**
|
23 | * @method constructor
|
24 | * @param {Object} cfg The configuration properties for the Matcher
|
25 | * instance, specified in an Object (map).
|
26 | */
|
27 | constructor(cfg: MatcherConfig);
|
28 | /**
|
29 | * Parses the input `text` and returns the array of { Autolinker.match.Match Matches}
|
30 | * for the matcher.
|
31 | *
|
32 | *
|
33 | * String} text The text to scan and replace matches in.
{ |
34 | * {Autolinker.match.Match[]}
|
35 | */
|
36 | abstract parseMatches(text: string): Match[];
|
37 | }
|
38 | export interface MatcherConfig {
|
39 | tagBuilder: AnchorTagBuilder;
|
40 | }
|