import { type ChatGPTCodexTokenSet, type CodexAuthJsonWriter } from "./codexAuthPersistence.js";
export type ChatGPTCodexRefreshExchange = (request: {
    issuer: string;
    clientId: string;
    refreshToken: string;
}) => Promise<Partial<ChatGPTCodexTokenSet>>;
export type RefreshChatGPTCodexTokenResult = {
    ok: true;
    publicSnapshot: unknown;
    authFilePath?: string;
    publicSafe: true;
    events: readonly string[];
} | {
    ok: false;
    error: {
        code: "MISSING_REFRESH_TOKEN" | "REFRESH_FAILED" | "PERSISTENCE_REQUIRED";
        message: string;
        publicSafe: true;
    };
    events: readonly string[];
};
export declare const exchangeChatGPTCodexRefreshToken: ChatGPTCodexRefreshExchange;
export declare function refreshChatGPTCodexToken(input: {
    previousTokens: ChatGPTCodexTokenSet;
    issuer?: string;
    clientId?: string;
    exchange?: ChatGPTCodexRefreshExchange;
    authFilePath?: string;
    writeAuthJson?: CodexAuthJsonWriter;
    now?: Date | (() => Date);
}): Promise<RefreshChatGPTCodexTokenResult>;
