interface TombaStatusResponse { domain: string; webmail: boolean; disposable: boolean; } interface Options { apiUrl?: string; disposable?: DisposableOptions; webmail?: WebmailOptions; emailError?: ErrorOptions; data?: TombaStatusResponse[]; } interface DefaultOptions { apiUrl: string; disposable: DisposableOptions; webmail: WebmailOptions; emailError: ErrorOptions; data: TombaStatusResponse[]; } interface WebmailOptions { message: string; block?: boolean; } interface DisposableOptions { message: string; } interface ErrorOptions { className?: string; style?: string; } /** * Blocker - Block Fake Disposable Email Addresses */ declare class Blocker { options: DefaultOptions; private activeElement; private activeForm; email: string; domain: string; valid: boolean; disposable: boolean; webmail: boolean; private emailError; /** * Blocker constructor */ constructor(options?: Options); /** * init : add Handlers */ private init; /** * inputHandlers : sets up the input handlers by attaching an 'input' event listener to the document, */ private inputHandlers; /** * clickHandlers : sets up the click handlers by attaching an 'click' event listener to the document, */ private clickHandlers; /** * inputHandlers : sets up the submit handlers by attaching an 'submit' event listener to the document, */ private submitHandlers; /** * mouseHandlers : This handler will be executed if tagName is `INPUT` and type is `email` and time the cursor. */ private mouseHandlers; /** * addStyle : appending it to the section */ private addStyle; /** * createErrorElement: Creates a new HTMLDivElement. * This element will be used to display error messages. * * @returns HTMLElement - The created HTMLDivElement. */ private createErrorElement; /** * showError: Adds the 'b_i_e' class to the active element, * * * @param message - The error message to display. */ private showError; /** * hideError: Removes the 'b_i_e' class from the active element. */ private hideError; /** * onInput: event listener * * @param event */ private onInput; /** * onSubmit: event listener for submission * * @param event */ private onSubmit; /** * onMouse: event listener for Mouse * * @param event */ private onMouse; /** * onClick: event listener for click * * @param event */ private onClick; /** * emailValidate: Basic Email Validate * * @param email * @returns boolean */ private emailValidate; /** * checkDomain: Search for the matching domain within the options data * @param domain * @returns */ checkDomain(domain: string): TombaStatusResponse; /** * customEvent: Method to dispatch custom events * @param eventName * @param eventData */ customEvent(eventName: string, eventData: TombaStatusResponse): void; /** * on: Method to listen for custom events * @param eventName * @param callback */ on(eventName: string, callback: any): void; } export { Blocker };