import { A as AuthToken } from './types-BxggH0Yh.js';

/**
 * Token storage abstraction and default filesystem implementation.
 */

/** Token storage interface for server-side token management */
interface ITokenStore {
    /** Save a token for a provider. Overwrites if exists. */
    save(provider: string, token: AuthToken): Promise<void>;
    /** Load a previously saved token. Returns null if not found. */
    load(provider: string): Promise<AuthToken | null>;
    /** Remove a specific provider's token. */
    clear(provider: string): Promise<void>;
    /** Remove all stored tokens. */
    clearAll(): Promise<void>;
    /** List provider names that have saved tokens. */
    list(): Promise<string[]>;
    /** Release any resources held by this store (optional). */
    dispose?(): Promise<void>;
}
/** In-memory token store for testing and ephemeral use */
declare class InMemoryTokenStore implements ITokenStore {
    private readonly tokens;
    save(provider: string, token: AuthToken): Promise<void>;
    load(provider: string): Promise<AuthToken | null>;
    clear(provider: string): Promise<void>;
    clearAll(): Promise<void>;
    list(): Promise<string[]>;
}
/** Options for FileTokenStore */
interface FileTokenStoreOptions {
    /** Directory to store token JSON files. Default: ".tokens" in cwd */
    directory: string;
}
/** Filesystem-based token store using JSON files (one per provider) */
declare class FileTokenStore implements ITokenStore {
    private readonly dir;
    constructor(options: FileTokenStoreOptions);
    save(provider: string, token: AuthToken): Promise<void>;
    load(provider: string): Promise<AuthToken | null>;
    clear(provider: string): Promise<void>;
    clearAll(): Promise<void>;
    list(): Promise<string[]>;
    private filePath;
}

export { FileTokenStore as F, type ITokenStore as I, type FileTokenStoreOptions as a, InMemoryTokenStore as b };
