/**
 * Cloud storage for mailx settings — Google Drive API (drive.file scope).
 *
 * Uses a single app-owned "mailx" folder on Drive, accessed by folder ID.
 * The drive.file scope only sees files/folders created by this OAuth client,
 * which prevents conflicts with existing folders of the same name.
 * All machines using the same OAuth client ID share the same folder.
 *
 * OneDrive (restored 2026-07-12): Microsoft Graph, PATH-addressed (no folder
 *   IDs — `root:/{path}:/content`), so the whole GDrive folder-ID
 *   discovery/validation/ownership machinery has no OneDrive counterpart.
 *   Needs ~/.rmfmail/microsoft-credentials.json (Azure public-client app;
 *   same registration the Outlook Graph mail provider uses — different
 *   scopes on the same token infrastructure).
 *
 * Dropbox (removed 2026-04-06): Never implemented — placeholder only.
 *   Would need Dropbox OAuth app, token management, and Dropbox API v2 calls.
 */
/** Verify a cached folder ID still points to an `.rmfmail`-named folder
 *  the user owns and isn't trashed. Returns true if the ID is good to use,
 *  false if mailx should drop it and re-discover via gDriveFindOrCreateFolder.
 *
 *  Catches the cross-version-corruption case: 1.0.504 had a buggy folder
 *  lookup that created an empty `rmfmail` folder at My Drive root and cached
 *  its ID. Once 1.0.505 fixed the lookup, the cached ID still pointed at the
 *  buggy folder forever — mailx kept reading the 1-account stub instead of
 *  the user's real `home/.rmfmail/accounts.jsonc`. This validator forces a
 *  re-discovery whenever the cached ID is wrong. */
export declare function gDriveValidateCachedFolder(folderId: string): Promise<boolean>;
/** Find or create the rmfmail settings folder on Google Drive.
 *
 *  Lookup order — match the Android side (`mailx-store-web/android-bootstrap.ts`):
 *    1. `home/.rmfmail/` — the established convention. Bob's family-of-two
 *       layout has been here since the rebrand. Path scope (`'root' in
 *       parents` for `home`, then `<homeId> in parents` for `.rmfmail`) is
 *       what the Android side does, so desktop matches.
 *    2. `.rmfmail/` at My Drive root — fallback for users who don't have a
 *       `home/` folder. Mostly hypothetical; included so a brand-new Drive
 *       still works.
 *    3. Create `.rmfmail` at My Drive root if neither exists. Don't auto-
 *       create `home/` — that's a user-organization choice we shouldn't
 *       make for them.
 *
 *  Previously this looked for a literal `rmfmail` (no dot) at root, which
 *  on clean install created a NEW empty folder alongside the real data,
 *  orphaning the user's accounts/contacts/etc. Switched to the dotted name
 *  matching the actual folder convention. */
export declare function gDriveFindOrCreateFolder(): Promise<string | null>;
export type CloudProvider = "gdrive" | "google" | "onedrive" | "local";
export interface CloudFile {
    /** Read a file. For gdrive, path is just the filename (folder ID is implicit). */
    read(filePath: string): Promise<string | null>;
    /** Read a file as raw bytes, base64-encoded (binary-safe). */
    readBinary(filePath: string): Promise<string | null>;
    /** Write a file. For gdrive, path is just the filename. Throws on failure with a descriptive error. */
    write(filePath: string, content: string): Promise<void>;
    /** Check if a file exists. */
    exists(filePath: string): Promise<boolean>;
}
/**
 * Get a cloud file provider. The locator is provider-specific: gdrive takes
 * the folder ID; onedrive takes the base PATH under the drive root (e.g.
 * "home/.rmfmail"). Files are stored flat in that folder either way — the
 * CloudFile contract is identical, only the FS API underneath differs.
 */
export declare function getCloudProvider(provider: string, locator?: string): CloudFile | null;
/** Fetch the authenticated Google user's profile (name + email) via the People API.
 *  Caller must supply an OAuth access token whose scopes include `contacts.readonly`
 *  or `userinfo.profile`. The Drive token (drive.file) does NOT have the right scope
 *  on its own — use the Gmail/IMAP OAuth token instead (mailx-imap's
 *  ImapManager.getOAuthToken). Returns null on failure. */
export declare function getGoogleProfile(token: string): Promise<{
    name?: string;
    email?: string;
} | null>;
//# sourceMappingURL=cloud.d.ts.map