/**
 * @fileoverview Token Storage Adapter
 *
 * Provides the method to convert between:
 * 1. Legacy TokenStore (callback-based) to SDK-Gen TokenStorage (promise-based)
 * 2. Legacy TokenInfo structure to sdk-gen AccessToken structure
 */
import { AccessToken } from '../sdk-gen/schemas/accessToken';
import { TokenStorage } from '../sdk-gen/box/tokenStorage';
export interface LegacyTokenInfo {
    accessToken: string;
    refreshToken?: string;
    accessTokenTTLMS: number;
    acquiredAtMS: number;
}
export interface LegacyTokenStore {
    read(callback: (err: Error | null, tokenInfo: LegacyTokenInfo | null) => void): void;
    write(tokenInfo: LegacyTokenInfo, callback: (err: Error | null) => void): void;
    clear(callback: (err: Error | null) => void): void;
}
export declare function convertLegacyTokenInfoToAccessToken(legacyTokenInfo: LegacyTokenInfo | null): AccessToken | undefined;
/**
 * Convert sdk-gen AccessToken to legacy TokenInfo
 *
 * @param accessToken The sdk-gen AccessToken
 * @param acquiredAtMS Optional timestamp of when token was acquired (defaults to now)
 */
export declare function convertAccessTokenToLegacyTokenInfo(accessToken: AccessToken | null | undefined, acquiredAtMS?: number): LegacyTokenInfo | null;
/**
 * Adapter class that wraps a legacy callback-based TokenStore
 * and makes it compatible with sdk-gen's promise-based TokenStorage interface
 */
export declare class LegacyTokenStoreAdapter implements TokenStorage {
    private legacyStore;
    constructor(legacyStore: LegacyTokenStore);
    /**
     * Store an AccessToken by converting it to legacy TokenInfo format
     */
    store(token: AccessToken): Promise<undefined>;
    /**
     * Retrieve an AccessToken by reading legacy TokenInfo and converting it
     */
    get(): Promise<AccessToken | undefined>;
    /**
     * Clear the token store
     */
    clear(): Promise<undefined>;
}
/**
 * Convenience function to wrap a legacy TokenStore as sdk-gen TokenStorage
 */
export declare function wrapLegacyTokenStore(legacyStore: LegacyTokenStore): TokenStorage;
