1 | import { Match, MatchConfig } from "./match";
|
2 | /**
|
3 | * @class Autolinker.match.Phone
|
4 | * @extends Autolinker.match.Match
|
5 | *
|
6 | * Represents a Phone number match found in an input string which should be
|
7 | * Autolinked.
|
8 | *
|
9 | * See this class's superclass ({@link Autolinker.match.Match}) for more
|
10 | * details.
|
11 | */
|
12 | export declare class PhoneMatch extends Match {
|
13 | /**
|
14 | * @protected
|
15 | * @property {String} number (required)
|
16 | *
|
17 | * The phone number that was matched, without any delimiter characters.
|
18 | *
|
19 | * Note: This is a string to allow for prefixed 0's.
|
20 | */
|
21 | private readonly number;
|
22 | /**
|
23 | * @protected
|
24 | * @property {Boolean} plusSign (required)
|
25 | *
|
26 | * `true` if the matched phone number started with a '+' sign. We'll include
|
27 | * it in the `tel:` URL if so, as this is needed for international numbers.
|
28 | *
|
29 | * Ex: '+1 (123) 456 7879'
|
30 | */
|
31 | private readonly plusSign;
|
32 | /**
|
33 | * @method constructor
|
34 | * @param {Object} cfg The configuration properties for the Match
|
35 | * instance, specified in an Object (map).
|
36 | */
|
37 | constructor(cfg: PhoneMatchConfig);
|
38 | /**
|
39 | * Returns a string name for the type of match that this class represents.
|
40 | * For the case of PhoneMatch, returns 'phone'.
|
41 | *
|
42 | * @return {String}
|
43 | */
|
44 | getType(): string;
|
45 | /**
|
46 | * Returns the phone number that was matched as a string, without any
|
47 | * delimiter characters.
|
48 | *
|
49 | * Note: This is a string to allow for prefixed 0's.
|
50 | *
|
51 | * @return {String}
|
52 | */
|
53 | getPhoneNumber(): string;
|
54 | /**
|
55 | * Alias of {@link #getPhoneNumber}, returns the phone number that was
|
56 | * matched as a string, without any delimiter characters.
|
57 | *
|
58 | * Note: This is a string to allow for prefixed 0's.
|
59 | *
|
60 | * @return {String}
|
61 | */
|
62 | getNumber(): string;
|
63 | /**
|
64 | * Returns the anchor href that should be generated for the match.
|
65 | *
|
66 | * @return {String}
|
67 | */
|
68 | getAnchorHref(): string;
|
69 | /**
|
70 | * Returns the anchor text that should be generated for the match.
|
71 | *
|
72 | * @return {String}
|
73 | */
|
74 | getAnchorText(): string;
|
75 | }
|
76 | export interface PhoneMatchConfig extends MatchConfig {
|
77 | number: string;
|
78 | plusSign: boolean;
|
79 | }
|