import { OAuthError } from "oauth-callback";
import type { UploadConfig } from "./config.ts";
export interface Tokens {
    access_token: string;
    refresh_token?: string;
    expires_at?: number;
    token_type: string;
    scope: string;
}
/**
 * Loads stored tokens for a specific OAuth client.
 * Returns null if no tokens exist or they cannot be read.
 */
export declare function loadTokens(config: UploadConfig): Promise<Tokens | null>;
/**
 * Removes stored tokens for a specific OAuth client.
 */
export declare function clearTokens(config: UploadConfig): Promise<void>;
/**
 * Gets valid tokens, refreshing if necessary.
 * Returns null if no tokens exist or refresh fails.
 */
export declare function getValidTokens(config: UploadConfig): Promise<Tokens | null>;
/**
 * Performs OAuth login flow - opens browser for user consent.
 * Stores tokens on success for future use.
 */
export declare function login(config: UploadConfig): Promise<Tokens>;
/**
 * Ensures we have valid tokens - loads existing or triggers login.
 */
export declare function ensureAuthenticated(config: UploadConfig): Promise<Tokens>;
export interface UploadResult {
    fileId: string;
    name: string;
    webViewLink?: string;
}
/**
 * Uploads a file to Google Drive. Updates existing file if found with same name.
 */
export declare function uploadFile(filePath: string, config: UploadConfig): Promise<UploadResult>;
/**
 * Uploads multiple files to Google Drive.
 */
export declare function uploadFiles(filePaths: string[], config: UploadConfig): Promise<UploadResult[]>;
export { OAuthError };
