/**
 * Reads and writes OAuth tokens and wizard-scoped session data under
 * `~/.amplitude/wizard/oauth-session.json` (canonical). Migrates from legacy
 * `~/.ampli.json` on first read when the canonical file has no OAuth entries.
 *
 * JSON shape matches the historical on-disk format (nested `User-*` entries
 * with OAuth* keys) so tokens remain portable across wizard versions.
 */
import { type AmplitudeZone } from '../lib/constants.js';
/** @deprecated Use {@link getOAuthSettingsFile} — kept for tests and imports. */
export declare const AMPLI_CONFIG_PATH: string;
export interface StoredOAuthToken {
    accessToken: string;
    idToken: string;
    refreshToken: string;
    expiresAt: string;
}
export interface StoredUser {
    id: string;
    firstName: string;
    lastName: string;
    email: string;
    zone: AmplitudeZone;
    tosAccepted?: boolean;
    tosAcceptedAt?: string;
}
/** Returns the first real (non-pending) stored user, or undefined if none. */
export declare function getStoredUser(configPath?: string): StoredUser | undefined;
/** Returns a valid (non-expired) stored token, or undefined. */
export declare function getStoredToken(userId?: string, zone?: AmplitudeZone, configPath?: string): StoredOAuthToken | undefined;
/** Persists OAuth tokens to the wizard session store (and legacy mirror). */
export declare function storeToken(user: StoredUser, token: StoredOAuthToken, configPath?: string): void;
/** Persists a user + token as the sole stored account, wiping any prior User entries. */
export declare function replaceStoredUser(user: StoredUser, token: StoredOAuthToken, configPath?: string): void;
/** Clears all stored credentials by writing an empty config. */
export declare function clearStoredCredentials(configPath?: string): void;
/**
 * Returns the last-used org/workspace/app selection triple. Each field is
 * individually optional — a user who has never had a workspace picked can
 * still have an orgId from an org-only run.
 *
 * Field naming matches the canonical session shape (`selectedAppId`,
 * `selectedWorkspaceId`, `selectedOrgId`) so callers can spread directly
 * into the picker pre-focus logic without re-keying.
 */
export declare function getLastUsedSelection(configPath?: string): {
    orgId?: string;
    workspaceId?: string;
    appId?: string;
};
/**
 * Persist the last-used selection triple. Pass undefined to clear a level
 * (e.g. when the user selects a different org, the old workspace/app
 * shouldn't pre-focus the picker anymore). Other wizard-scoped settings
 * inside the `wizard` namespace are preserved.
 */
export declare function storeLastUsedSelection(selection: {
    orgId?: string;
    workspaceId?: string;
    appId?: string;
}, configPath?: string): void;
/**
 * Updates the stored user's zone in the session store, migrating the entry to the
 * new zone key. Returns the updated user, or undefined if no user is stored.
 */
export declare function updateStoredUserZone(newZone: AmplitudeZone, configPath?: string): StoredUser | undefined;
