Implement link matcher priorities

Fixes #549
This commit is contained in:
Daniel Imms
2017-03-02 11:25:27 -08:00
parent 670fb01fbf
commit 7ac4f1a9be
4 changed files with 71 additions and 15 deletions
+8
View File
@@ -2,5 +2,13 @@
* @license MIT
*/
export type LinkMatcher = {
id: number,
regex: RegExp,
handler: LinkMatcherHandler,
matchIndex?: number,
validationCallback?: LinkMatcherValidationCallback,
priority?: number
};
export type LinkMatcherHandler = (uri: string) => void;
export type LinkMatcherValidationCallback = (uri: string, callback: (isValid: boolean) => void) => void;