declare const messages: { readonly TIKWM_SOURCE_INVALID: "TikWM 原视频链接无效,未发送请求"; readonly TIKWM_AUTH_REQUIRED: "TikWM 凭据无效或未配置,请在本机核对后继续"; readonly TIKWM_QUOTA_EXHAUSTED: "TikWM 月配额已用尽,已暂停取片"; readonly TIKWM_RATE_LIMITED: "TikWM 请求频率受限,已暂停取片"; readonly TIKWM_RESPONSE_INVALID: "TikWM 未返回可校验的成功结果,原任务保留"; readonly TIKWM_IDENTITY_MISMATCH: "TikWM 返回的作品身份不一致,未接受其他视频"; readonly TIKWM_MEDIA_INVALID: "TikWM 未返回有效的原片媒体,原任务保留"; readonly TIKWM_MEDIA_TOO_LARGE: "TikWM 原片超过允许大小,已停止下载"; readonly TIKWM_NETWORK_ERROR: "TikWM 网络请求未完成,原任务保留,请核对后继续"; readonly TIKWM_TIMEOUT: "TikWM 请求超时,原任务保留,未自动重试"; readonly TIKWM_CANCELLED: "TikWM 请求已取消,原任务保留"; readonly TIKWM_QUOTA_SAVE_FAILED: "TikWM 配额记录未能保存,已停止继续取片"; readonly TIKWM_FILE_WRITE_FAILED: "TikWM 原片未能安全保存,原任务保留"; }; export declare class TikwmApiError extends Error { readonly code: keyof typeof messages; readonly disposition = "pause"; constructor(code: keyof typeof messages); } export type TikwmQuotaWindow = { limit: number | null; remaining: number | null; resetAtSeconds: number | null; }; export type TikwmQuota = { monthly: TikwmQuotaWindow; minute: TikwmQuotaWindow; }; type Options = { fetch?: typeof fetch; signal?: AbortSignal; timeoutMs?: number; }; type ResolveOptions = Options & { onQuota?: (quota: TikwmQuota) => void | Promise; }; export type TikwmResolvedVideo = { id: string; author: string; mediaUrl: string; durationSeconds: number | null; }; /** Resolves only the selected public item. Never sends a browser cookie or the API key to media hosts. */ export declare function resolveTikwmVideo(sourceUrl: string, key: string, options?: ResolveOptions): Promise; /** The caller owns the destination directory and runs ffprobe before promoting this file into its cache. */ export declare function downloadTikwmMedia(url: string, file: string, maxBytes: number, options?: Options): Promise<{ file: string; bytes: number; }>; export {};