15 lines
427 B
TypeScript
15 lines
427 B
TypeScript
/**
|
|
* @license MIT
|
|
*/
|
|
|
|
export type LinkMatcher = {
|
|
id: number,
|
|
regex: RegExp,
|
|
handler: LinkMatcherHandler,
|
|
matchIndex?: number,
|
|
validationCallback?: LinkMatcherValidationCallback,
|
|
priority?: number
|
|
};
|
|
export type LinkMatcherHandler = (event: MouseEvent, uri: string) => boolean | void;
|
|
export type LinkMatcherValidationCallback = (uri: string, element: HTMLElement, callback: (isValid: boolean) => void) => void;
|