import { Nullable, SafelinkOptions } from './'; import { default as _parseQuery } from './parseQuery'; export type DOMElement = globalThis.Element; export type HTMLElement = globalThis.HTMLElement; export default class safelink { options: Required; constructor(opt?: Partial); parseQuery: typeof _parseQuery; /** * is url excluded * @param url * @returns */ isExcluded(url: string | URL): boolean; /** * parse html string or element to anonymize urls * @param target * @returns */ parse(target: Nullable | HTMLElement | Buffer | NodeJS.ReadStream): Promise; /** * parse single url * @param url * @returns return redirect url or original url * * when redirect not set, will return encoded URL only */ parseUrl(url: string): string | null; /** * anonymize url directly * @param href */ encodeURL(href: string): string; /** * Resolve query url to decrypt anonymized urls (page redirector) * @param search * @returns */ resolveQueryUrl(search?: string): Partial; }