import { type CollectorError } from "./collector-parse.js";
export { isCollectorError, type CollectorError } from "./collector-parse.js";
/** True when the collector can actually run: BOTH the bundled script exists AND
 *  the managed venv (f2 + browser_cookie3) is provisioned (S4). When false the
 *  refresh path returns a structured "run setup" error instead of spawning a
 *  doomed python3 — no more silent ENOENT (#72). */
export declare function isCollectorAvailable(): boolean;
export interface CreatorData {
    platform: string;
    collected_at: string;
    account: {
        nickname: string;
        follower_count: number;
        following_count: number;
        total_favorited: number;
        aweme_count: number;
        [key: string]: unknown;
    };
    works: Array<{
        aweme_id: string;
        desc: string;
        create_time: number;
        play_count: number;
        digg_count: number;
        comment_count: number;
        share_count: number;
        collect_count: number;
        [key: string]: unknown;
    }>;
    summary: {
        total_works_collected: number;
        avg_play: number;
        avg_digg: number;
        avg_comment: number;
        avg_share: number;
        avg_collect: number;
        engagement_rate: number;
    };
}
/** Throwable wrapper around a structured CollectorError so async callers (the
 *  refresh route) can `try/catch` and map `.detail.code` → HTTP status + an
 *  actionable, localized "re-login" prompt. Carries the pure CollectorError as
 *  `.detail` rather than flattening, so no field is lost across the boundary. */
export declare class CollectorRunError extends Error {
    readonly detail: CollectorError;
    constructor(detail: CollectorError);
}
/**
 * Run the managed-venv Douyin collector once and persist the result.
 *
 * Resolves to the typed CreatorData on success. THROWS a `CollectorRunError`
 * (carrying a structured CollectorError) on any failure — expired cookie,
 * not-logged-in, invalid URL, crash, unprovisioned venv — so the caller can
 * surface an actionable message instead of a silent empty page. The cron path
 * still calls this with `.catch(() => {})`, so a background failure stays quiet.
 *
 * The browser cookie (sessionid) is read by the Python script directly from the
 * user's own browser via browser_cookie3 and never leaves the machine; this
 * function only sees the script's JSON stdout.
 */
export declare function collectData(douyinUrl: string): Promise<CreatorData>;
export declare function getLatestCreatorData(): Promise<CreatorData | null>;
export declare function getCreatorHistory(days?: number): Promise<Array<{
    date: string;
    data: CreatorData;
}>>;
export declare function startAnalyticsCollector(): Promise<void>;
export declare function stopAnalyticsCollector(): void;
//# sourceMappingURL=analytics-collector.d.ts.map