import type { MediaCache, TranscriptCache } from "../cache/types.js";
import type { TranscriptionConfig } from "../transcript/transcription-config.js";
import type { CacheMode, TranscriptSource } from "./types.js";
export declare const ProgressKind: {
    readonly FetchHtmlStart: "fetch-html-start";
    readonly FetchHtmlProgress: "fetch-html-progress";
    readonly FetchHtmlDone: "fetch-html-done";
    readonly TranscriptMediaDownloadStart: "transcript-media-download-start";
    readonly TranscriptMediaDownloadProgress: "transcript-media-download-progress";
    readonly TranscriptMediaDownloadDone: "transcript-media-download-done";
    readonly TranscriptWhisperStart: "transcript-whisper-start";
    readonly TranscriptWhisperProgress: "transcript-whisper-progress";
    readonly TranscriptStart: "transcript-start";
    readonly TranscriptDone: "transcript-done";
    readonly FirecrawlStart: "firecrawl-start";
    readonly FirecrawlDone: "firecrawl-done";
    readonly NitterStart: "nitter-start";
    readonly NitterDone: "nitter-done";
    readonly BirdStart: "bird-start";
    readonly BirdDone: "bird-done";
};
export type CloudTranscriptionProviderHint = "groq" | "assemblyai" | "elevenlabs" | "gemini" | "openai" | "fal" | "deepgram";
export type TranscriptionProviderHint = "cpp" | "onnx" | "unknown" | CloudTranscriptionProviderHint | `${CloudTranscriptionProviderHint}->${string}`;
/** Public progress events emitted by link preview fetchers. */
export type LinkPreviewProgressEvent = {
    kind: "fetch-html-start";
    url: string;
} | {
    kind: "fetch-html-progress";
    url: string;
    downloadedBytes: number;
    totalBytes: number | null;
} | {
    kind: "fetch-html-done";
    url: string;
    downloadedBytes: number;
    totalBytes: number | null;
} | {
    kind: "transcript-media-download-start";
    url: string;
    service: "youtube" | "podcast" | "generic";
    mediaUrl: string | null;
    mediaKind?: "video" | "audio" | null;
    totalBytes: number | null;
} | {
    kind: "transcript-media-download-progress";
    url: string;
    service: "youtube" | "podcast" | "generic";
    downloadedBytes: number;
    totalBytes: number | null;
    mediaKind?: "video" | "audio" | null;
} | {
    kind: "transcript-media-download-done";
    url: string;
    service: "youtube" | "podcast" | "generic";
    downloadedBytes: number;
    totalBytes: number | null;
    mediaKind?: "video" | "audio" | null;
} | {
    kind: "transcript-whisper-start";
    url: string;
    service: "youtube" | "podcast" | "generic";
    providerHint: TranscriptionProviderHint;
    modelId: string | null;
    totalDurationSeconds: number | null;
    parts: number | null;
} | {
    kind: "transcript-whisper-progress";
    url: string;
    service: "youtube" | "podcast" | "generic";
    processedDurationSeconds: number | null;
    totalDurationSeconds: number | null;
    partIndex: number | null;
    parts: number | null;
} | {
    kind: "transcript-start";
    url: string;
    service: "youtube" | "podcast" | "generic";
    hint: string | null;
} | {
    kind: "transcript-done";
    url: string;
    ok: boolean;
    service: "youtube" | "podcast" | "generic";
    source: TranscriptSource | null;
    hint: string | null;
} | {
    kind: "firecrawl-start";
    url: string;
    reason: string;
} | {
    kind: "firecrawl-done";
    url: string;
    ok: boolean;
    markdownBytes: number | null;
    htmlBytes: number | null;
} | {
    kind: "nitter-start";
    url: string;
} | {
    kind: "nitter-done";
    url: string;
    ok: boolean;
    textBytes: number | null;
} | {
    kind: "bird-start";
    url: string;
    client?: "xurl" | "bird" | null;
} | {
    kind: "bird-done";
    url: string;
    client?: "xurl" | "bird" | null;
    ok: boolean;
    textBytes: number | null;
};
export interface FirecrawlScrapeResult {
    markdown: string;
    html?: string | null;
    metadata?: Record<string, unknown> | null;
}
export type ScrapeWithFirecrawl = (url: string, options?: {
    cacheMode?: CacheMode;
    timeoutMs?: number;
}) => Promise<FirecrawlScrapeResult | null>;
export type ConvertHtmlToMarkdown = (args: {
    url: string;
    html: string;
    title: string | null;
    siteName: string | null;
    timeoutMs: number;
}) => Promise<string>;
export type BirdTweetMedia = {
    kind: "video" | "audio";
    urls: string[];
    preferredUrl: string | null;
    source: "extended_entities" | "card" | "entities" | "xurl";
};
export type BirdTweetPayload = {
    id?: string;
    text: string;
    author?: {
        username?: string;
        name?: string;
    };
    createdAt?: string;
    media?: BirdTweetMedia | null;
    client?: "xurl" | "bird";
};
export type ReadTweetWithBird = (args: {
    url: string;
    timeoutMs: number;
}) => Promise<BirdTweetPayload | null>;
export type TwitterCookieSource = {
    cookiesFromBrowser: string | null;
    source?: string | null;
    warnings?: string[];
};
export type ResolveTwitterCookies = (args: {
    url: string;
}) => Promise<TwitterCookieSource>;
/** Internal dependency bag; prefer createLinkPreviewClient unless you need custom wiring. */
export interface LinkPreviewDeps {
    fetch: typeof fetch;
    env?: Record<string, string | undefined>;
    scrapeWithFirecrawl: ScrapeWithFirecrawl | null;
    apifyApiToken: string | null;
    ytDlpPath: string | null;
    transcription?: TranscriptionConfig | null;
    falApiKey?: string | null;
    groqApiKey?: string | null;
    assemblyaiApiKey?: string | null;
    deepgramApiKey?: string | null;
    elevenlabsApiKey?: string | null;
    geminiApiKey?: string | null;
    openaiApiKey?: string | null;
    convertHtmlToMarkdown: ConvertHtmlToMarkdown | null;
    transcriptCache: TranscriptCache | null;
    mediaCache?: MediaCache | null;
    readTweetWithBird?: ReadTweetWithBird | null;
    resolveTwitterCookies?: ResolveTwitterCookies | null;
    onProgress?: ((event: LinkPreviewProgressEvent) => void) | null;
}
