/**
 * Browser-compatible settings for Android/WebView.
 * Replaces @bobfrankston/mailx-settings which depends on node:fs.
 *
 * Settings are stored in IndexedDB and synced to Google Drive
 * via the GDrive API (same API as desktop cloud mode).
 *
 * On first run, settings are fetched from GDrive. Subsequent reads
 * use the local IndexedDB cache. Writes go to both.
 */
import type { AccountConfig, MailxSettings, AutocompleteSettings } from "@bobfrankston/mailx-types";
export declare function setGDriveTokenProvider(provider: () => Promise<string>): void;
export declare function setGDriveFolderId(folderId: string, folderName?: string, ownerEmail?: string, folderPath?: string): void;
export declare function cloudRead(filename: string): Promise<string | null>;
export declare function cloudWrite(filename: string, content: string): Promise<boolean>;
/** Cheap freshness probe: one Drive metadata request (no content download).
 *  Returns the file's modifiedTime, or null if unreachable / missing. */
export declare function cloudStat(filename: string): Promise<{
    id: string;
    modifiedTime: string;
} | null>;
declare const DEFAULT_PREFERENCES: {
    ui: {
        theme: "system";
        editor: "quill";
        folderWidth: number;
        listViewerSplit: number;
        fontSize: number;
    };
    sync: {
        intervalMinutes: number;
        historyDays: number;
        prefetch: boolean;
    };
    autocomplete: {
        enabled: boolean;
        provider: "off";
        ollamaUrl: string;
        ollamaModel: string;
        cloudApiKey: string;
        cloudModel: string;
        debounceMs: number;
        maxTokens: number;
    };
};
declare const DEFAULT_ALLOWLIST: {
    senders: string[];
    domains: string[];
    recipients: string[];
    flaggedSenders: string[];
    flaggedDomains: string[];
};
/** Prime the shared configs from GDrive. The lazy stale-while-revalidate
 *  path alone left the phone a step behind: the read that TRIGGERS the pull
 *  is still served the stale cache, so a desktop approval only took effect
 *  on the *second* message opened — and an app update didn't help, because
 *  IndexedDB survives a reinstall (Bob 2026-07-31: "approved a site on my
 *  PC … reinstall didn't pick up the new approval on Android"). Called once
 *  GDrive auth is live at boot and again on resume, so the cache is already
 *  current before the first message is rendered. */
export declare function primeSharedConfigs(force?: boolean): Promise<void>;
/** Load accounts — first from IndexedDB cache, then GDrive */
export declare function loadAccounts(): Promise<AccountConfig[]>;
/** Load accounts directly from GDrive, bypassing local cache */
export declare function loadAccountsFromCloud(): Promise<AccountConfig[]>;
/** Save accounts to IndexedDB and GDrive */
export declare function saveAccounts(accounts: AccountConfig[]): Promise<void>;
/** Load preferences */
export declare function loadPreferences(): Promise<typeof DEFAULT_PREFERENCES>;
/** Save preferences */
export declare function savePreferences(prefs: any): Promise<void>;
/** Load full settings (accounts + preferences combined) */
export declare function loadSettings(): Promise<MailxSettings>;
/** Save full settings */
export declare function saveSettings(settings: MailxSettings): Promise<void>;
/** Load allowlist */
export declare function loadAllowlist(): Promise<typeof DEFAULT_ALLOWLIST>;
/** Read-modify-write against the FRESHEST copy. The load→mutate→save shape
 *  clobbered the shared file twice (2026-07-22/23): a phone whose cached
 *  base was 12 days stale wrote it back minus everything added since, and a
 *  fresh install whose base was DEFAULT_ALLOWLIST wiped the file to ~nothing
 *  (restored from Drive revisions). Mutations now apply to the live cloud
 *  copy when reachable; the cache is only the offline fallback. */
export declare function updateAllowlist(mutate: (list: typeof DEFAULT_ALLOWLIST) => typeof DEFAULT_ALLOWLIST | void): Promise<typeof DEFAULT_ALLOWLIST>;
/** Save allowlist. Backstop shrink guard: a write that would discard more
 *  than half of a substantial cloud copy is the wipe signature (stale or
 *  default base) — keep it out of the shared file. The local cache still
 *  updates so the device's own view is consistent; the next
 *  stale-while-revalidate pull re-syncs it with the cloud. */
export declare function saveAllowlist(list: typeof DEFAULT_ALLOWLIST): Promise<void>;
/** Load autocomplete settings */
export declare function loadAutocomplete(): Promise<AutocompleteSettings>;
/** Save autocomplete settings */
export declare function saveAutocomplete(settings: AutocompleteSettings): Promise<void>;
/** Get history days — read from preferences */
export declare function getHistoryDays(): Promise<number>;
/** Get prefetch setting */
export declare function getPrefetch(): Promise<boolean>;
/** Get storage info */
export declare function getStorageInfo(): {
    provider: string;
    mode: string;
    folderId?: string;
    folderName?: string;
    folderPath?: string;
    folderOwner?: string;
};
/** Clear all cached settings — used for "Reset Store" */
export declare function clearSettings(): Promise<void>;
/** Get or create a stable device ID (UUID stored in localStorage) */
export declare function getDeviceId(): string;
export {};
//# sourceMappingURL=web-settings.d.ts.map