diff --git a/src/module/interfaces/ngx-linkifyjs.interface.ts b/src/module/interfaces/ngx-linkifyjs.interface.ts index d2d00d88..7ca6ed6c 100644 --- a/src/module/interfaces/ngx-linkifyjs.interface.ts +++ b/src/module/interfaces/ngx-linkifyjs.interface.ts @@ -18,7 +18,15 @@ export interface NgxLinkifyOptions { nl2br?: boolean, tagName?: string, target?: { url: string }, - validate?: boolean, + validate?: NgxLinkifyOptionsValidator, format?(value: any, type: any): any, formatHref?(href: any, type: any): any, } + +export type NgxLinkifyOptionsValidator = boolean | validatorFunction | validatorObject +type validatorFunction = (value: string, type?: "url" | "email") => boolean +type validatorTypeFunction = (value: string) => boolean +interface validatorObject { + url?: validatorTypeFunction + email?: validatorTypeFunction +}