import { type Frame, type Page, type PuppeteerLifeCycleEvent } from 'puppeteer'; import { BaseScraper } from './base-scraper'; import { ScraperErrorTypes } from './errors'; import { type ScraperCredentials, type ScraperScrapingResult } from './interface'; declare enum LoginBaseResults { Success = "SUCCESS", UnknownError = "UNKNOWN_ERROR" } export declare const LoginResults: { Success: LoginBaseResults.Success; UnknownError: LoginBaseResults.UnknownError; TwoFactorRetrieverMissing: ScraperErrorTypes.TwoFactorRetrieverMissing; InvalidPassword: ScraperErrorTypes.InvalidPassword; ChangePassword: ScraperErrorTypes.ChangePassword; AccountBlocked: ScraperErrorTypes.AccountBlocked; }; export type LoginResults = Exclude | LoginBaseResults; export type PossibleLoginResults = { [key in LoginResults]?: (string | RegExp | ((options?: { page?: Page; }) => Promise))[]; }; export interface LoginOptions { loginUrl: string; checkReadiness?: () => Promise; fields: { selector: string; value: string; }[]; submitButtonSelector: string | (() => Promise); preAction?: () => Promise; postAction?: () => Promise; possibleResults: PossibleLoginResults; userAgent?: string; waitUntil?: PuppeteerLifeCycleEvent; } declare class BaseScraperWithBrowser extends BaseScraper { private cleanups; protected page: Page; protected getViewPort(): { width: number; height: number; }; initialize(): Promise; private initializePage; navigateTo(url: string, page?: Page, timeout?: number, waitUntil?: PuppeteerLifeCycleEvent | undefined): Promise; getLoginOptions(_credentials: ScraperCredentials): LoginOptions; fillInputs(pageOrFrame: Page | Frame, fields: { selector: string; value: string; }[]): Promise; login(credentials: ScraperCredentials): Promise; terminate(_success: boolean): Promise; private handleLoginResult; } export { BaseScraperWithBrowser };