| 1 |
import { Match, MatchConfig } from './match'; |
| 2 |
/** |
| 3 |
* @class Autolinker.match.Hashtag |
| 4 |
* @extends Autolinker.match.Match |
| 5 |
* |
| 6 |
* Represents a Hashtag 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 HashtagMatch extends Match { |
| 13 |
/** |
| 14 |
* @cfg {String} serviceName |
| 15 |
* |
| 16 |
* The service to point hashtag matches to. See {@link Autolinker#hashtag} |
| 17 |
* for available values. |
| 18 |
*/ |
| 19 |
private readonly serviceName; |
| 20 |
/** |
| 21 |
* @cfg {String} hashtag (required) |
| 22 |
* |
| 23 |
* The HashtagMatch that was matched, without the '#'. |
| 24 |
*/ |
| 25 |
private readonly hashtag; |
| 26 |
/** |
| 27 |
* @method constructor |
| 28 |
* @param {Object} cfg The configuration properties for the Match |
| 29 |
* instance, specified in an Object (map). |
| 30 |
*/ |
| 31 |
constructor(cfg: HashtagMatchConfig); |
| 32 |
/** |
| 33 |
* Returns a string name for the type of match that this class represents. |
| 34 |
* For the case of HashtagMatch, returns 'hashtag'. |
| 35 |
* |
| 36 |
* @return {String} |
| 37 |
*/ |
| 38 |
getType(): string; |
| 39 |
/** |
| 40 |
* Returns the configured {@link #serviceName} to point the HashtagMatch to. |
| 41 |
* Ex: 'facebook', 'twitter'. |
| 42 |
* |
| 43 |
* @return {String} |
| 44 |
*/ |
| 45 |
getServiceName(): string; |
| 46 |
/** |
| 47 |
* Returns the matched hashtag, without the '#' character. |
| 48 |
* |
| 49 |
* @return {String} |
| 50 |
*/ |
| 51 |
getHashtag(): string; |
| 52 |
/** |
| 53 |
* Returns the anchor href that should be generated for the match. |
| 54 |
* |
| 55 |
* @return {String} |
| 56 |
*/ |
| 57 |
getAnchorHref(): string; |
| 58 |
/** |
| 59 |
* Returns the anchor text that should be generated for the match. |
| 60 |
* |
| 61 |
* @return {String} |
| 62 |
*/ |
| 63 |
getAnchorText(): string; |
| 64 |
} |
| 65 |
export interface HashtagMatchConfig extends MatchConfig { |
| 66 |
serviceName: string; |
| 67 |
hashtag: string; |
| 68 |
} |