Implement link validation

Fixes #570
This commit is contained in:
Daniel Imms
2017-02-27 08:35:59 -08:00
parent cf4da6c748
commit 6198556e50
5 changed files with 70 additions and 12 deletions
+22
View File
@@ -2,6 +2,8 @@
* @license MIT
*/
import { LinkMatcherValidationCallback } from './Types';
export interface IBrowser {
isNode: boolean;
userAgent: string;
@@ -64,6 +66,26 @@ interface ICircularList<T> {
shiftElements(start: number, count: number, offset: number): void;
}
export interface LinkMatcherOptions {
/**
* The index of the link from the regex.match(text) call. This defaults to 0
* (for regular expressions without capture groups).
*/
matchIndex?: number;
/**
* A callback that validates an individual link, returning true if valid and
* false if invalid.
*/
validationCallback?: LinkMatcherValidationCallback;
}
/**
*
* @param a
*/
function a(a) {
}
/**
* Handles actions generated by the parser.
*/