import type { Page } from "patchright"; export declare class RateLimitError extends Error { suggestedWaitSeconds: number; constructor(message: string, suggestedWaitSeconds?: number); } export declare class AuthenticationError extends Error { constructor(message: string); } export declare class LinkedInScraperError extends Error { constructor(message: string); } export declare const sleep: (ms: number) => Promise; /** Random integer in [minMs, maxMs). */ export declare function jitterMs(minMs: number, maxMs: number): number; /** Sleep for a random duration in [minMs, maxMs). Defeats LinkedIn's "heartbeat" detection. */ export declare const sleepJitter: (minMs: number, maxMs: number) => Promise; /** * Warm-up domains visited before the first LinkedIn navigation in a session. * Mirrors stickerdaniel's `warm_up_browser`. Visiting a non-LinkedIn site first * mimics a user who arrived from a search result, instead of one whose browser * cold-starts straight into linkedin.com. */ export declare const WARM_UP_DOMAINS: readonly ["https://www.google.com", "https://www.wikipedia.org", "https://www.github.com"]; /** Pick one warm-up domain at random, navigate, pause briefly. Failures are silent. */ export declare function warmUpNavigation(page: import("patchright").Page, pauseRangeMs?: readonly [number, number]): Promise; /** * Activity-hours guard. Returns whether the current local hour falls in the * "off-hours" band [00:00, 06:00). Off-hours bursts are a documented LinkedIn * detection signal (top-5 per the rate-limit research). Caller decides whether * to warn or block — we default to warn-don't-block. */ export declare function isOffHoursLocal(now?: Date): boolean; /** * Detect rate-limit / security challenge. Mirrors core/utils.py:detect_rate_limit. * Throws RateLimitError on /checkpoint or /authwall, or on error-shaped pages * (no
, body text < 2000 chars) containing throttle phrases. */ export declare function detectRateLimit(page: Page): Promise; /** * Scroll the document to the bottom repeatedly to trigger lazy load. * `pauseRangeMs` is a [min, max] tuple — each iteration sleeps a random duration * within the range, breaking the uniform-cadence detection signal. */ export declare function scrollToBottom(page: Page, pauseRangeMs?: readonly [number, number], maxScrolls?: number): Promise; /** Best-effort dismissal of artdeco modals. Returns true if a modal was closed. */ export declare function handleModalClose(page: Page): Promise; export declare function truncateLinkedInNoise(text: string): string; export declare function filterLinkedInNoiseLines(text: string): string; export declare function stripLinkedInNoise(text: string): string; //# sourceMappingURL=utils.d.ts.map